[Solved] .concat() method is not working


Why not just map the values of data1 and concat then the data of data2 in each iteration for a new array?

var data1 = ['a', 'b', 'c'],
    data2 = ['d', 'e', 'f'],
    result = data1.map(function (a) {
        return [a].concat(data2);
    });

console.log(result);
.as-console-wrapper { max-height: 100% !important; top: 0; }

solved .concat() method is not working