append array to an array javascript code example
Example 1: javascript append element to array
var colors= ["red","blue"];
colors.push("yellow");
Example 2: js append to array
var array = [0,1,3];
array.append(5);
console.log(array); // [0,1,3,5]
Example 3: js combine two arrays
const letters = ['a', 'b', 'c'];
const numbers = [1, 2, 3];
letters.concat(numbers);
// result in ['a', 'b', 'c', 1, 2, 3]