Skip to content

Commit d7417b8

Browse files
authored
Merge pull request wesbos#25 from fedeguzman/patch-3
Removed the extra code from the start file
2 parents 2094f09 + caab9dd commit d7417b8

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

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

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,42 +25,15 @@
2525

2626
// Some and Every Checks
2727
// Array.prototype.some() // is at least one person 19?
28-
// const isAdult = people.some(function(person) {
29-
// const currentYear = (new Date()).getFullYear();
30-
// if(currentYear - person.year >= 19) {
31-
// return true;
32-
// }
33-
// });
34-
35-
const isAdult = people.some(person => ((new Date()).getFullYear()) - person.year >= 19);
36-
37-
console.log({isAdult});
3828
// Array.prototype.every() // is everyone 19?
3929

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

47-
48-
const comment = comments.find(comment => comment.id === 823423);
49-
50-
console.log(comment);
51-
5234
// Array.prototype.findIndex()
5335
// Find the comment with this ID
5436
// 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);
59-
60-
const newComments = [
61-
...comments.slice(0, index),
62-
...comments.slice(index + 1)
63-
];
6437

6538
</script>
6639
</body>

0 commit comments

Comments
 (0)