I need to take slice of 2d array with binary code. I need to specify where I want to start and where will be the end.
For now I have this code, but I'm pretty sure it's wrong:
var slice = [[]];
var endx = 30;
var startx = 20;
var starty = 10;
var end = 20;
for (var i = sx, a = 0; i < json_data.length, a < ex; i++, a++) {
for (var j = sy, b = 0; j < json_data[1].length, b < ey; j++, b++)
slice[a][b] == json_data[i][j];
}
json_data
is an array in format:
[0,0,0,0,0,1,...],[1,1,0,1,1,0...],...
it is 600x600