Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript merge two array with spread operator

const a = ['to', 'code'];
const b = ['learning', ...a, 'is', 'fun']; 
console.log(b); //> ['learning', 'to', 'code', 'is', 'fun']
 
PREVIOUS NEXT
Tagged: #javascript #merge #array #spread #operator
ADD COMMENT
Topic
Name
1+1 =