two ways to find the index of an element in an array #coding #javascript

preview_player
Показать описание
#javascript #coding #tutorial #shorts #asmr

indexOf(): returns the first index at which a given element can be found in an array. Otherwise, returns -1.

findIndex(): returns the index of the first element in an array that satisfies the provided testing function. Otherwise, returns -1.

Please review the MDN docs on indexOf() and findIndex() for additional information.
Рекомендации по теме
Комментарии
Автор

indexOf(): returns the first index at which a given element can be found in an array. Otherwise, returns -1.

findIndex(): returns the index of the first element in an array that satisfies the provided testing function. Otherwise, returns -1.

theengineeringnotes
join shbcf.ru