flatten2dArrayTo(array, target) {
    let offset = 0;
    for (let y = 0; y < array.length; y++) {
      target.set(array[y], offset);
      offset += array[y].length;
    }
  }
Puts a nested 2d array into a one-dimensional target array
@param {Array|*} array
@param {Float32Array|Float64Array} target