mercredi 18 juin 2014

Trying to create multi-dimensional arrays programmatically


Vote count:

0




Im testing my ability to create multi dimensional arrays with for loops with:



for (var a = 0; a < 3; a++){
var pax[a] = new Array();
pax[a].push(1,2,3);
}

console.log(pax[2][1],pax[0][0]);


But its giving me a syntax error unexpected token at the [ of var pax[a]


I think it actually might be a scope error vs a syntax error, but I cant be sure.



asked 5 mins ago






Aucun commentaire:

Enregistrer un commentaire