What is the difference between Object Literals and Array Literals in JavaScript? I know it has something to do with the length method but i don\'t fully understand it.
The difference is the way they're indexed.
Objects have name, value pairs which are not ordered. In some browsers the order you added values will be the order you get when you traverse the object but not in all. The name is usually a string.
Arrays are numerically indexed and the order is totally reliable