Skip to content

Commit f793dde

Browse files
committed
Fix typo (fixes nzakas#346)
1 parent 01c97f7 commit f793dde

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

manuscript/B-ECMAScript-7.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ console.log(values.indexOf(NaN)); // -1
9898
console.log(values.includes(NaN)); // true
9999
```
100100

101-
The `values.indexOf()` method returns `-1` for `NaN` even though `NaN` is contained in the `values` array. On the other hand, `values.includes()` returns `true` for `NaN` because it uses a different value comparison operator used.
101+
The `values.indexOf()` method returns `-1` for `NaN` even though `NaN` is contained in the `values` array. On the other hand, `values.includes()` returns `true` for `NaN` because it uses a different value comparison operator.
102102

103103
W> When you want to check just for the existence of a value in an array and don't need to know the index , I recommend using `includes()` because of the difference in how `NaN` is treated by the `includes()` and `indexOf()` methods. If you do need to know where in the array a value exists, then you have to use the `indexOf()` method.
104104

0 commit comments

Comments
 (0)