![Get the index of the first matching item in an array](https://javascriptsource.com/wp-content/uploads/2022/06/Get-the-index-of-the-first-matching-item-in-an-array-702x526.jpg)
Get the index of the first matching item in an array. Returns -1
if no matching item is found.
var sandwiches = ['turkey', 'tuna', 'blt', 'pb&jb'];
// returns 1
sandwiches.indexOf('tuna');
// returns -1
sandwiches.indexOf('ham');
Source
https://vanillajstoolkit.com/reference/arrays/array-indexof.md/