May 8, 2017
Javascript: 二维数组转一维数组(合并数组) Convert a 2D array to a 1D array
Here, I’m trying to convert arrToConvert to a 1D array.
var arrToConvert = [[0,0,1],[2,3,3],[4,4,5]];
console.log(get1DArray(arrToConvert)); //print the converted array
function get1DArray(2dArr){
//concatenate each element of the input into a 1D array, and return the output
//what would be the best way to implement this function?
}
 … Read More