Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion 07 - Array Cardio Day 2/index-START.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>Array Cardio 💪💪</title>
</head>
<body>
<p><em>Psst: have a look at the JavaScript Console</em> 💁</p>
<p><em>Psst: have a look at the JavaScript Console</em> </p>
<script>
// ## Array Cardio Day 2

Expand All @@ -26,6 +26,14 @@

// Some and Every Checks
// Array.prototype.some() // is at least one person 19 or older?
const isAdult = people.some(function(person){
const currentYear = (new Date()).getFullYear();
if(currentYear - person.year >= 19) {
return true;
}
});

console.log(isAdult);
// Array.prototype.every() // is everyone 19 or older?

// Array.prototype.find()
Expand Down