javascript add element to array site:stackoverflow.com code example
Example: js push to array site:stackoverflow.com
// initialize array
let arr = ['Hi', 'Hello', 'Bonjour'];
let arr2 = new Array('Hi', 'Hello', 'Bonjour');
// append new value to the array
arr.push("Hola");
arr2.push("Hola");