indexOf and lastIndexOf Array Methods | JavaScript Tutorial

preview_player
Показать описание

In this tutorial we're going to learn about the #indexOf and #lastIndexOf #JavaScript Array Methods and how they can be used in order to retrieve the index at which an item is found inside of an array.
If the element is not inside the array, the methods will return -1.

---
Follow me on:
Рекомендации по теме
Комментарии
Автор

nice trick. didn't know about it. thanks

rocktimsaikia
Автор

You saved my a** onе more time. Thank you man, great job

strelnikov
Автор

What can we do if we have another "Ivan", the third one somewhere in the middle, and we want to find that index.

minnuss
Автор

What happen if we have more than three Ivan..

prabhatchaukar