I have a array like
var arr = [["one", "two"],["three", "four"],["five", "six", "seven"],["eight", "nine"]];
I am trying to make all the elements unite the elements, but the elements in the same sub-array must not replicate. like:
var output = ["one three four five six seven eight nine","two three four five six seven eight nine"];
This will be added based on number of elements in the first sub array.
I tried it but couldn't find any solution. Can anyone help.?
This is my code i tried :
function big_for( data ){
var aj = [];
var k = 0;
for( var i = 0; i < data.length; i++ ){
for( var j = 0; j < data[i].length; j++ ){
aj[k] = data[i][j];
k++;
}
}
return arr;
}
Thanks in advance.!