How to append two arrays to another array in Node.js

1 Answer

0 votes
const arr1 = [799, 1, 2, 8, 9, 5, 5, 1, 7];
        
const arr2 = ['node.js', 'c'];

const arr3 = [...arr1, ...arr2];

console.log(arr3); 


      
      
/*
run:
      
[ 799, 1, 2, 8, 9, 5, 5, 1, 7, 'node.js', 'c' ]
        
*/

 



answered Jun 28, 2022 by avibootz

Related questions

1 answer 106 views
1 answer 140 views
1 answer 157 views
1 answer 76 views
1 answer 103 views
1 answer 214 views
...