I\'m trying to create an associative array, create an empty array, and then add a (indexName -> value) pair:
indexName
var arrayName = new Array; arrayName[\
You would use objects to do that:
var hash = {} hash["foo"] = "foo"; hash.bar = "bar"; // This is the dynamic approach: Your key is a string: baz = "baz" hash[baz] = "hello";
To iterate, just use a for loop or $.each() in jQuery.
for
$.each()