What is associative array?
Its an array who’s index is a string instead of a number.
What do you mean by it?
// Array var myArr = Array(3); myArr = 34; myArr = 'rajakvk'; // legal store all types in a single array. ;-) myArr= 25.5; //Associative array var myArr = Array(3); myArr['age'] = 34; myArr['what is his name'] = 'rajakvk'; myArr["what is his father's name"] = 'kvk'; myArr['his average']= 25.5;
Yes. You can use string, with space too. Even you get to know father’s name !!
alert(myArr); //undefined That reminds again, great power comes with great responsibility.