Skip to content

Commit

Permalink
Merge pull request javascript-tutorial#3292 from a-v-gor/proofreading
Browse files Browse the repository at this point in the history
fix typo, remove pleonasm
  • Loading branch information
iliakan authored Dec 11, 2022
2 parents 1ce5644 + 8375316 commit 3f305f5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions 1-js/05-data-types/05-array-methods/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ alert( arr.includes(1) ); // true

Please note that `indexOf` uses the strict equality `===` for comparison. So, if we look for `false`, it finds exactly `false` and not the zero.

If we want to check if `item` exists in the array, and don't need the exact index, then `arr.includes` is preferred.
If we want to check if `item` exists in the array, and don't need the index, then `arr.includes` is preferred.

The method [arr.lastIndexOf](mdn:js/Array/lastIndexOf) is the same as `indexOf`, but looks for from right to left.

Expand Down Expand Up @@ -338,8 +338,6 @@ alert(users.findIndex(user => user.name == 'John')); // 0
alert(users.findLastIndex(user => user.name == 'John')); // 3
```
### filter
The `find` method looks for a single (first) element that makes the function return `true`.
Expand Down

0 comments on commit 3f305f5

Please sign in to comment.