Merge pull request #3025 from Rnbsov/patch-55

👾 add clarifying example
This commit is contained in:
Ilya Kantor 2022-06-13 23:46:57 +02:00 committed by GitHub
commit c028189aba
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(false) ); // 2
alert( arr.indexOf(null) ); // -1 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 alert( arr.includes(1) ); // true
``` ```