Using tensorflow.js on Google Chrome I noticed an unexpected behaviour extracting values from an array.
The code is very simple:
console.log(boxes); // Array of 1200 positions.
let order = [];
for (let i = 0; i < 10; i++) {
order.push(boxes[i*4 + 1]);
}
console.log(order); // Array of 10 positions with values from 'boxes'.
The source array boxes is the following:
The destination array order is the following:
When I copy values from the original array boxes, all the values in the order array are 2. I tried to parse the values to a string, but the result is the same:
Tested on Firefox and same result.
Why does this happen?


