JavaScript
Article
By Sam Deering

jQuery Find Index of Array Item

By 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.

--ADVERTISEMENT--

//syntax
jQuery.inArray( value, array )

//example
jQuery.inArray("Sam", array)
Recommended
Sponsors
The most important and interesting stories in tech. Straight to your inbox, daily. Get Versioning.
Login or Create Account to Comment
Login Create Account