Using the JavaScript indexOf Array Method

preview_player
Показать описание
The 'indexOf' array method returns the index position of the array where the supplied value is found. If the item is not found, -1 is returned. Using this method instead of creating a loop and searching for an element yourself can save you time and make your code cleaner.
Рекомендации по теме