d= [1, 2, 3] + [1,2,3]
This does not concatenate arrays, you need:
var someVar = array1.concat(array2);
If you use +
on arrays they will get coerced to strings then concatenated so you actually get a string containing "1,2,31,2,3"
Strings don't have a map
function and that's why you get the error
You probably need to put var
in front of that d
variable so it doesn't leak into the global scope.