Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

convert the following 2 d array into 1 d array in javascript

var arrToConvert = [[0,0,1],[2,3,3],[4,4,5]];
var newArr = [];


for(var i = 0; i < arrToConvert.length; i++)
{
    newArr = newArr.concat(arrToConvert[i]);
}

console.log(newArr);
 
PREVIOUS NEXT
Tagged: #convert #array #array #javascript
ADD COMMENT
Topic
Name
1+1 =