My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
indexOf  
Overview of indexOf
Updated May 10, 2010 by matr...@mac.com

indexOf

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

Usage

objx( iterable ).indexOf( needle );

iterable The iterable object to search through to find needle
needle The object to look for

Example

var 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
Powered by Google Project Hosting