Skip to content

Commit e0f547b

Browse files
author
John Carlo Buenaflor
committed
08 completed
1 parent a5672dd commit e0f547b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,19 @@
2626

2727
// Some and Every Checks
2828
// Array.prototype.some() // is at least one person 19?
29+
people.some(p => new Date().getFullYear() - p.year === 19)
2930
// Array.prototype.every() // is everyone 19?
31+
people.every(p => new Date().getFullYear() - p.year === 19)
3032

3133
// Array.prototype.find()
3234
// Find is like filter, but instead returns just the one you are looking for
3335
// find the comment with the ID of 823423
36+
comments.find(c => c.id === 823423)
3437

3538
// Array.prototype.findIndex()
3639
// Find the comment with this ID
3740
// delete the comment with the ID of 823423
41+
comments.splice(comments.findIndex(c => c.id === 823423), 1)
3842

3943
</script>
4044
</body>

0 commit comments

Comments
 (0)