|
indexOf
Overview of indexOf
indexOfAction that finds the position in an iterable object where the specified object is found. Or returns -1 if it cannot be found. The indexOf plugin provides a cross-browser implementation of the normal indexOf method in JavaScript. Usageobjx( iterable ).indexOf( needle );
Examplevar a = ["a", "b", "c", "d", "e"];
objx(a).indexOf("a");
// returns 0
objx(a).indexOf("d");
// returns 3
objx(a).indexOf("x");
// returns -1
| ||||
► Sign in to add a comment