how to push an element into an array in javascript

JavaScript
var colors=["red","white"];
colors.push("blue");//append 'blue' to colorsarray.push(element)var colors= ["red","blue"];
	colors.push("yellow"); // initialize array
var arr = [
  "Hi",
  "Hello",
  "Bonjour"
];

// append new value to the array
arr.push("Hola");

console.log(arr);
Source

Also in JavaScript: