Here is my array:
var array = [[0,1,0,1,0,1,0,1],
[1,0,1,0,1,0,1,0],
[0,1,0,1,0,1,0,1],
[0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0],
[2,0,2,0,2,0,2,0],
[0,2,0,2,0,2,0,2],
[2,0,2,0,2,0,2,0]];
How can I search in this array of arrays using just javascript? For example, how would I search if there is a 3 in this array of arrays?
javascript search array of arrays didn't help me, I might be attempting it wrong:
var result;
for( var i = 0, len = model.board.length; i < len; i++ ) {
if( model.board[i][0] == 3 ) {
result = selected_products[i];
alert("found a 3 " + result);
}
}