From b8348a117ef43f144c68045c074310437e7c37f0 Mon Sep 17 00:00:00 2001 From: Anthony Date: Wed, 2 Aug 2017 20:14:38 -0700 Subject: [PATCH 1/2] First Prob --- 6-12_JS.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/6-12_JS.js b/6-12_JS.js index 7932d92..83265f4 100644 --- a/6-12_JS.js +++ b/6-12_JS.js @@ -15,6 +15,9 @@ var list1 = [ // Your task is to return the number of JavaScript developers coming from Europe. // Use .filter +function JSDevs(babaloo) { + return babaloo.filter((devs) => devs.continent == 'Europe' && devs.language == 'JavaScript').length +} // Should return 3 From 02890460fa89033e16978d3dbc58d26052382414 Mon Sep 17 00:00:00 2001 From: Anthony Date: Thu, 3 Aug 2017 15:35:10 -0700 Subject: [PATCH 2/2] Second Prob Done --- 6-12_JS.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/6-12_JS.js b/6-12_JS.js index 83265f4..f1db45a 100644 --- a/6-12_JS.js +++ b/6-12_JS.js @@ -16,8 +16,10 @@ var list1 = [ // Use .filter function JSDevs(babaloo) { - return babaloo.filter((devs) => devs.continent == 'Europe' && devs.language == 'JavaScript').length + console.log(babaloo.filter((devs) => devs.continent == 'Europe' && devs.language == 'JavaScript').length) } + +JSDevs(list1); // Should return 3 @@ -48,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.