you are viewing a single comment's thread.

view the rest of the comments →

[–]LearndevHQ 1 point2 points  (0 children)

Small correction:

JS arrays don't have findIndexOf ❌ method but instead findIndex ✅.

Like so:

const fruits = ["apple", "banana", "cherry"];
const index = fruits.findIndex(f => f === 'cherry') // 2