🤯 60% OFF BLACK FRIDAY SALE 650+ books, courses & coding assessments!

jQuery Find Index of Array Item

Sam Deering

Simple jQuery code snippet to find the index of an array item given the item value. It’s a bit like the .NET Array.FindIndex Method but use the in Array function.

jQuery.inArray( value, array )

jQuery.inArray("Sam", array)