Skip to content

Commit fc499bb

Browse files
committed
Add method indexOf
1 parent 6d63953 commit fc499bb

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

app5.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ const arr3 = arr1.concat(arr2);
55

66
console.log(arr3) // [1,2,3,10,20,30]
77

8+
9+

app6.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const arr1 = ['string 1', 'string 2', 'string 3']
2+
3+
console.log(arr1.indexOf(arr1.at(-1))) // 2
4+
console.log(arr1.indexOf('string 2')) // 1

0 commit comments

Comments
 (0)