How to merge multiple arrays in Node.js

1 Answer

0 votes
const arr1 = [9, 130, 99];
const arr2 = [81, 400];
const arr3 = [1, 2, 3, 4];
  
const arr = [...arr1, ...arr2, ...arr3];
  
console.log(arr);


       
/*
run:
     
[ 9, 130, 99, 81, 400, 1,   2,  3,  4 ]
   
*/
 

 



answered Nov 1, 2024 by avibootz

Related questions

1 answer 221 views
1 answer 160 views
2 answers 317 views
1 answer 142 views
2 answers 158 views
158 views asked Dec 14, 2022 by avibootz
1 answer 136 views
136 views asked Feb 21, 2022 by avibootz
...