Skip to content

Commit b3b0ce6

Browse files
committed
MVP complete
1 parent 98443f0 commit b3b0ce6

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

assignments/array-methods.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,25 @@ console.log(ticketPriceTotal);
9393
// Now that you have used .forEach(), .map(), .filter(), and .reduce(). I want you to think of potential problems you could solve given the data set and the 5k fun run theme. Try to create and then solve 3 unique problems using one or many of the array methods listed above.
9494

9595
// Problem 1
96+
let Association = [];
97+
runners.forEach(function (list){
98+
Association.push(list.first_name +' '+ list.last_name + ' joins us from, ' + list.company_name);
99+
});
100+
101+
console.log(Association);
96102

97103
// Problem 2
104+
// Each runner is allowed up to 2 viewing guest, the possible number of attendees
105+
let Attendees= [];
106+
Attendees = runners.reduce((total, item) => {
107+
return total = item.id + (item.id*2);
108+
}, 0);
109+
console.log("The maximum number of attendees allowed is " + Attendees);
98110

99-
// Problem 3
111+
// Problem 3
112+
// let's see who works for the same companioes
113+
let company= [];
114+
company = runners.filter(function co (items){
115+
return items.company_name === 'Skinix';
116+
});
117+
console.log (company);

assignments/closure.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
// ==== Challenge 1: Write your own closure ====
22
// Write a simple closure of your own creation. Keep it simple!
3-
3+
function firstName() {
4+
var name = 'Chawn';
5+
function Greeting() {
6+
console.log('Hello my name is ' + name);
7+
}
8+
Greeting();
9+
}
10+
firstName();
411

512
/* STRETCH PROBLEMS, Do not attempt until you have completed all previous tasks for today's project files */
613

0 commit comments

Comments
 (0)