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 252 views
2 answers 468 views
1 answer 220 views
2 answers 284 views
284 views asked Dec 14, 2022 by avibootz
1 answer 226 views
226 views asked Feb 21, 2022 by avibootz
...