Array.index (Property)

A special property provided only when the array results from a string match.


JavaScript - 1.2
JScript - 5.5
Internet Explorer - 5.5
Netscape - 4.0
Property/method value type:Number primitive
JavaScript syntax:-myArray.index

When the String.match() method is used, it returns an array as a result. If the match used a pattern that made only a single match (i.e. the g attribute was not used) then the array returned will have this additional index property.

The index property will contain the character location within the original string where the match occurred.

See also:Array.input, RegExp.exec(), String.match()