Skip to content

Commit a30a7a2

Browse files
committed
finished 7th day challenge
1 parent c08944f commit a30a7a2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@
2727

2828
// Some and Every Checks
2929
// Array.prototype.some() // is at least one person 19 or older?
30+
// const isAdult = people.people.some(function(person){
31+
// const currentYear = (new.Date()).getFullYear();
32+
// if(currentYear- person.year >=19){
33+
// return true;
34+
// }
35+
// })
36+
37+
const isAdult = people.some(person=> ((new Date()).getFullYear()) - person.year >= 19);
38+
console.log({isAdult});
3039
// Array.prototype.every() // is everyone 19 or older?
3140

3241
// Array.prototype.find()

0 commit comments

Comments
 (0)