-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodingMeetup2Greeting.js
32 lines (26 loc) · 1.65 KB
/
codingMeetup2Greeting.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// You will be given an array of objects (associative arrays in PHP, tables in COBOL) representing data about developers who have signed up to attend the next coding meetup that you are organising.
// Your task is to return an array where each object will have a new property 'greeting' with the following string value:
// Hi < firstName here >, what do you like the most about < language here >?
// For example, given the following input array:
// var list1 = [
// { firstName: 'Sofia', lastName: 'I.', country: 'Argentina', continent: 'Americas', age: 35, language: 'Java' },
// { firstName: 'Lukas', lastName: 'X.', country: 'Croatia', continent: 'Europe', age: 35, language: 'Python' },
// { firstName: 'Madison', lastName: 'U.', country: 'United States', continent: 'Americas', age: 32, language: 'Ruby' }
// ];
// your function should return the following array:
// [
// { firstName: 'Sofia', lastName: 'I.', country: 'Argentina', continent: 'Americas', age: 35, language: 'Java',
// greeting: 'Hi Sofia, what do you like the most about Java?'
// },
// { firstName: 'Lukas', lastName: 'X.', country: 'Croatia', continent: 'Europe', age: 35, language: 'Python',
// greeting: 'Hi Lukas, what do you like the most about Python?'
// },
// { firstName: 'Madison', lastName: 'U.', country: 'United States', continent: 'Americas', age: 32, language: 'Ruby',
// greeting: 'Hi Madison, what do you like the most about Ruby?'
// }
// ];
function greetDevelopers(list) {
// thank you for checking out my kata :)
list.forEach(elem => elem.greeting = `Hi ${elem.firstName}, what do you like the most about ${elem.language}?` )
return list
}