Tell the difference between indexed array and associative array?

Indexed arrays: .length property is one greater than the highest index used. Sequentially indexed arrays can be traversed with for(var i=0; i<arr.length; i++){...} . Sequentially and non-sequentially indexed (sparse) arrays can be traversed with for(var prop in arr){...} .

Associative arrays: .length property stays at zero. Traverse with for(var prop in arr){...} .

There's plenty more about javascript arrays already on the web.

Airshow

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.