👾 add clarifying example

This commit is contained in:
Lavrentiy Rubtsov 2022-05-24 02:08:03 +06:00 committed by GitHub
parent 2efe0dce18
commit c7cc166f72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -249,6 +249,10 @@ alert( arr.indexOf(0) ); // 1
alert( arr.indexOf(false) ); // 2
alert( arr.indexOf(null) ); // -1
let fruits = ['Plum', 'Apple', 'Orange', 'Plum']
// note that the lastIndexOf method looks for from the end, but index counted from beginning
alert( fruits.lastIndexOf(Plum)) // 3
alert( arr.includes(1) ); // true
```