I figured out the issue I was having. For anyone who is wondering, the track array I was passing in was an array of string values, when it needed to be an array of actual numbers, so I converted each of the strings to numbers using Number() in JavaScript. Here's the nested loop I wrote to do this, don't know if it's the best way but it works:
let track = new Array(trackStr.length);
for (i = 0; i < trackStr.length; i++) {
    track[i] = new Array(trackStr[0].length); // Initialize an empty array of the correct dimensions
}
for (j = 0; j < trackStr[0].length; j++) {
    for (i = 0; i < trackStr.length; i++) {
        if (trackStr[i][j]) { // Check that this array index has a value that exists
            track[i][j] = (Number(trackStr[i][j])); // Insert the numerical version of the string into the same position in the empty array. (Note Number method is used because it handles scientific notation values too)
        }
    }
}