Associative Arrays in JavaScript
Associative Arrays
As we know, JavaScript Arrays support numbered indexes but we can give them named indexes. However, this is not recommended as we have JavaScript Objects for this purpose. Moreover, many JavaScript properties like length, concat may not work in this case. For this purpose, we use Associative Arrays.
Syntax:-
var my_arr = [];
my_arr["index_name"] = "value";
my_arr["index_name"] = "value";