indexOf vs findIndex Array methods in JavaScript

preview_player
Показать описание
indexOf() vs findIndex()

This makes it a good choice to find the index in arrays of
primitive types (like string, number, or boolean).

Use this if you need the index in arrays with non-primitive types (e.g. objects) or
your find condition is more complex than just a value.
Рекомендации по теме