Skip to content

Commit c028189

Browse files
authored
Merge pull request #3025 from Rnbsov/patch-55
👾 add clarifying example
2 parents 97202cb + c7cc166 commit c028189

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

1-js/05-data-types/05-array-methods/article.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,10 @@ alert( arr.indexOf(0) ); // 1
249249
alert( arr.indexOf(false) ); // 2
250250
alert( arr.indexOf(null) ); // -1
251251

252+
let fruits = ['Plum', 'Apple', 'Orange', 'Plum']
253+
// note that the lastIndexOf method looks for from the end, but index counted from beginning
254+
alert( fruits.lastIndexOf(Plum)) // 3
255+
252256
alert( arr.includes(1) ); // true
253257
```
254258

0 commit comments

Comments
 (0)