combine array code example
Example 1: merge two arrays one as key to another php
// two arrays one become keys and second becomes values
array_combine ( array $keys , array $values );
Example 2: 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 ];