Mitleser: Dynamische Array-Namen

Beitrag lesen

var myArray = [];
myArray['A'] = new Array("a", "b", "c");
myArray['B'] = new Array("d", "e", "f");

Wohl eher:

var myObj = {};
myObj['A'] = ["a", "b", "c"];
myObj['B'] = ["d", "e", "f"];

Bzw. direkt:

var myObj = {
    'A' : ["a", "b", "c"],
    'B' : ["d", "e", "f"]
};