Skip to content

Commit d883f12

Browse files
committed
Made start of 07 a true start
1 parent 77441c9 commit d883f12

1 file changed

Lines changed: 1 addition & 20 deletions

File tree

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

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,37 +30,18 @@
3030
// if(currentYear - person.year >= 19) {
3131
// return true;
3232
// }
33-
// });
33+
// });console.log({isAdult});
3434

35-
const isAdult = people.some(person => ((new Date()).getFullYear()) - person.year >= 19);
36-
37-
console.log({isAdult});
3835
// Array.prototype.every() // is everyone 19?
3936

40-
const allAdults = people.every(person => ((new Date()).getFullYear()) - person.year >= 19);
41-
console.log({allAdults});
42-
4337
// Array.prototype.find()
4438
// Find is like filter, but instead returns just the one you are looking for
4539
// find the comment with the ID of 823423
4640

47-
48-
const comment = comments.find(comment => comment.id === 823423);
49-
50-
console.log(comment);
51-
5241
// Array.prototype.findIndex()
5342
// Find the comment with this ID
5443
// delete the comment with the ID of 823423
55-
const index = comments.findIndex(comment => comment.id === 823423);
56-
console.log(index);
57-
58-
// comments.splice(index, 1);
5944

60-
const newComments = [
61-
...comments.slice(0, index),
62-
...comments.slice(index + 1)
63-
];
6445

6546
</script>
6647
</body>

0 commit comments

Comments
 (0)