Associative Arrays
Associative arrays are like ordinary arrays except the indices are Strings instead of numbers.
The keys in an associative array have to be Strings.
The values can be anything, including other arrays or associative arrays.
Example of Associative Array
var capital = []; capital["India"] = "Delhi"; capital["Japan"] = "Tokyo"; colsole.log(capital["Japan"]);
Output :
Tokyo
© 2016, https:. All rights reserved. On republishing this post, you must provide link to original post