Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

combine 2 arrays javascript

//ES6 using the spread operator
const itemsA = [ 'Lightsaber', 'Mockingjay pin', 'Box of chocolates' ];
const itemsB = [ 'Ghost trap', 'The One Ring', 'DeLorean' ]
const allItems = [ ...itemsA, ...itemsB ];
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #combine #arrays #javascript
ADD COMMENT
Topic
Name
6+5 =