diff --git a/6-12_JS.js b/6-12_JS.js index 7932d92..f1db45a 100644 --- a/6-12_JS.js +++ b/6-12_JS.js @@ -15,6 +15,11 @@ var list1 = [ // Your task is to return the number of JavaScript developers coming from Europe. // Use .filter +function JSDevs(babaloo) { + console.log(babaloo.filter((devs) => devs.continent == 'Europe' && devs.language == 'JavaScript').length) +} + +JSDevs(list1); // Should return 3 @@ -45,11 +50,16 @@ var list1 = [ } ]; +list1.map((person) => { + person.greeting = 'Hi ' + person.firstName + ', what do you like the most about ' + person.language + '?'; + console.log(person); +}) // The trick is to return a person, adding the property as we go // you will need a block statement // Use .map + // PROBLEM #3 // // You will be given an array of objects (associative arrays in PHP) representing data about developers who have signed up to attend the next coding meetup that you are organising. The list is ordered according to who signed up first.