Skip to content
This repository was archived by the owner on Feb 13, 2022. It is now read-only.

Commit bbc36e7

Browse files
committed
solution wesbos#7
1 parent cfc87d9 commit bbc36e7

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

07 - Array Cardio Day 2/index-START.html

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,21 @@
3131
// return true;
3232
// }
3333
// });
34-
35-
const isAdult = people.some(person => ((new Date()).getFullYear()) - person.year >= 19);
36-
34+
const isAdult = people.some(person =>
35+
((new Date()).getFullYear()) - person.year >= 19
36+
);
3737
console.log({isAdult});
38-
// Array.prototype.every() // is everyone 19?
3938

40-
const allAdults = people.every(person => ((new Date()).getFullYear()) - person.year >= 19);
39+
// Array.prototype.every() // is everyone 19?
40+
const allAdults = people.every(person =>
41+
((new Date()).getFullYear()) - person.year >= 19
42+
);
4143
console.log({allAdults});
4244

4345
// Array.prototype.find()
4446
// Find is like filter, but instead returns just the one you are looking for
4547
// find the comment with the ID of 823423
46-
47-
4848
const comment = comments.find(comment => comment.id === 823423);
49-
5049
console.log(comment);
5150

5251
// Array.prototype.findIndex()
@@ -56,7 +55,6 @@
5655
console.log(index);
5756

5857
// comments.splice(index, 1);
59-
6058
const newComments = [
6159
...comments.slice(0, index),
6260
...comments.slice(index + 1)

0 commit comments

Comments
 (0)