JavaScript index Property: Array Object
Description
The index property is a read-only property. It contains the position of a regular expression match within a string.
Version
Implemented in JavaScript 1.2
Syntax
array.index
Example:
In the following web document a regular expression string that contains the search string 'fox'. The match() method is used to find the regular expression within the string 'str1'. The index property is used to get the position of the word 'fox' within the string 'str1'
HTML Code
JS Code
View the example in the browser
Practice the example online
JavaScript Array object - index Property exampleSee also:
JavaScript Core objects, methods, properties.
Previous: JavaScript constructor Property: Array Object
Next:
JavaScript input Property: Array Object
Test your Programming skills with w3resource's quiz.