Answers for "concat two arrays each value react typescript"

0

concat two arrays each value react typescript

var array1 = [1,2,3,4];
var array2 = [5,-6,7,8.5];

const concatArr = (arr1, arr2, sep) => arr1.map(function (num, idx) {
  return num.toString().concat(sep,(arr2[idx]).toString())
});

console.log(concatArr(array1,array2,"#")) //["1#5", "2#-6", "3#7", "4#8.5"]
Posted by: Guest on May-18-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language