im trying to build a javascript matrix as an object.
i tied :
var variations={};
variations["p1088"]["red"]["gen"]=1107;
variations["p1090"]["red"]["l"]=1288;
and
var variations={};
variations.p1088.red.gen=1107;
variations.p1090.red.gen=1288;
but both throws an exception
TypeError: variations.p1090 is undefined
whats wrong here ?
because you cannot assume that p1088, red, and gen are objects. This works: