Cannot set property 'className' of undefined
Uncaught TypeError: Cannot set property 'className' of undefined
at refreshDiv (game.js:56)
at Game.init (game.js:73)
at Local.start (local.js:11)
at script.js:2
var refreshDiv = function(data,divs){
for(var i=0; i<data.length; i++){
for(var j=0; j<data[0].length; j++){
if(data[i][j] == 0){
divs[i][j].className = "none";
} else if(data[i][j] == 1){
divs[i][j].className = "none";
} else if(data[i][j] == 2){
divs[i][j].className = "none";
}
}
}
}