In continuation of Array Cardio Day 1 I am presented with some arrays[] of data. I use array methods to manipulate the data.
.some() - Method to check if one of the items is true. In this project I check if one person is >= 19.
.every() - Method to check if all of the items are true. In this project I check if every person is >= 19.
.find() - Find is like .filter(), but instead of returning a subset of the array, it only returns the first one it finds. In this project I find a comment with a specific ID (comment.id === 823423).
.findIndex() - Finds the index value of the item in an array. In this project I find the index of the comment ID that is to be removed.
... spread - Spreading items into an array. In this project I spread all of the comments back into the array and slice out the 'index' that is to be removed.
See the Pen
JavaScript30 - 7 - Array Cardio Day 2 by Corey Noble (@CoreyNoble)
on CodePen.