Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
iliakan committed Nov 1, 2017
1 parent ccc0e93 commit 973810d
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion 1-js/05-data-types/05-array-methods/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@ Note that the methods use `===` comparison. So, if we look for `false`, it finds

If we want to check for inclusion, and don't want to know the exact index, then `arr.includes` is preferred.

Also, a very minor difference of `include` is that it correctly handles `NaN`, unlike `indexOf/lastIndexOf`:

```js run
const arr = [NaN];
alert( arr.indexOf(NaN) ); // -1 (should be 0, but === equality doesn't work for NaN)
alert( arr.includes(NaN) );// true (correct)
```

### find and findIndex

Expand Down Expand Up @@ -703,7 +710,7 @@ A cheatsheet of array methods:
- Additionally:
- `Array.isArray(arr)` checks `arr` for being an array.

Of all these methods only `sort`, `reverse` and `splice` modify the array itself, the other ones only return a value.
Please note that methods `sort`, `reverse` and `splice` modify the array itself.

These methods are the most used ones, they cover 99% of use cases. But there are few others:

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ...bject-oriented-programming/08-class-patterns/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 2-ui/1-document/09-size-and-scroll/metric-offset-parent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 2-ui/1-document/09-size-and-scroll/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures.sketch
Binary file not shown.

0 comments on commit 973810d

Please sign in to comment.