JavaScript, return index of an element in array
Recently I’ve been working on a project with HTML5's <video> tag event handling and I needed to check if an element exists in the array. Quick googling resulted in neat native JavaScript method Array.indexOf. It returns the first index at which a given element can be found in an array, or -1 if it is not... Read more »