I am using the following code to create an array of grid coordinates. After pulling my hair out for quite some time, I did a trace (typeof) and found out that the coordinates are going into the array as objects. Obviously, I need numbers. Does anyone know how to convert the array values to numbers instead of objects?
(as you can see, I wrapped my push command with the Number() operator, but it still turns out to be objects!)
gridCoords = new Array();
function createCoords() {
gridx = 190;
gridy = 190;
for (var i = 0; i<=loopNumber; i++) {
for (var j = 0; j<3; j++) {
gridCoords.push([[Number(gridx*j)], [Number(gridy*i)]]);
}
}
}