Gets the index of a specified target value in a string, array or an object. Unlike Array.prototype.indexOf(), this function works for finding NaN and differentiates between -0 and 0.

This function is valid in v2.13.0 to v2.14.2. This function has been downloaded 2 times.


{Array|Object|string} subject
The array, object or string in which target should be searched for.
{*} target
The target value to search for within subject.
{number=} opt_start Optional
The position at which to start the search for strings or arrays. This will be ignored for objects. Negative values will be calculated from the end.


If subject is an array or a string this will be a integer representing the first position at which target is found within subject or this will be -1 which represents that target was not found. If subject is an object this will be key at which target was first found (based on Object.keys()) or undefined if target was not found.

Required Function

This function requires the following function which is included automatically:

  • typeOf()
    Either gets the type of a value or adds a constructor registering its custom type name.