add element to end of array code example
Example 1: javascript append to array
var colors=["red","white"];
colors.push("blue");
Example 2: javascript append element to array
var colors= ["red","blue"];
colors.push("yellow");
Example 3: javascript array add end
let yourArray = [1, 2, 3];
yourArray.push(4);
Example 4: push array javascript
let array = ["A", "B"];
let variable = "what you want to add";
array.push(variable);
console.log(array);
Example 5: add value to array javascript
var fruits = ["222", "vvvv", "eee", "eeee"];
fruits.push("Kiwi");
Example 6: javascript append array to end of array
const new_array = old_array.concat([value1[, value2[, ...[, valueN]]]])