Do arrays use the number you type in a form field and match Index numbers or does the array count down the number of array objects with the number you typed in?

When you type a number to a text field to search in an array, does it look for an exact number match, or does it count down the number of array items with the number you typed in?

For Example, When I type in a number 4 in a form field, am I asking asking JavaScript to find the index number 4, i.e., find an exact match between the string "6" typed in the form to the 6 in the bracket [6]) OR am I asking JavaScript to count down four array items?