File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 2626
2727 // Some and Every Checks
2828 // Array.prototype.some() // is at least one person 19 or older?
29+ console . log (
30+ people . some ( person => new Date ( ) . getFullYear ( ) - person . year >= 19 )
31+ )
2932 // Array.prototype.every() // is everyone 19 or older?
33+ console . log (
34+ people . every ( person => new Date ( ) . getFullYear ( ) - person . year >= 19 )
35+ )
3036
3137 // Array.prototype.find()
3238 // Find is like filter, but instead returns just the one you are looking for
3339 // find the comment with the ID of 823423
40+ console . log (
41+ comments . find ( comment => comment . id === 823423 )
42+ )
3443
3544 // Array.prototype.findIndex()
3645 // Find the comment with this ID
3746 // delete the comment with the ID of 823423
47+ const index = comments . findIndex ( comment => comment . id === 823423 )
48+ comments . splice ( index , 1 ) ;
49+ console . log ( comments ) ;
3850
3951 </ script >
4052</ body >
You can’t perform that action at this time.
0 commit comments