Friday, 9 August 2013

First element in array

First element in array

Why do indexes in arrays always start with 0? Does it have something to do
with binary? For example:
var myArray = [5,6,7,8];
To access the number 5, you would have to say
myArray[0]
But why?
No, I don't have a real problem. As you can evidently tell I'm new to this
stuff.

No comments:

Post a Comment