add item to array javascript

JavaScript
var vegetables = ['Capsicum',' Carrot','Cucumber','Onion'];
vegetables.push('Okra');
//expected output ['Capsicum',' Carrot','Cucumber','Onion','Okra']; 
// .push adds a thing at the last of an arrayvar colors=["red","white"];
colors.push("blue");//append 'blue' to colorslet foo = ['oop','plop','copo'];
	foo.push("plop");// initialize array
var arr = [
  "Hi",
  "Hello",
  "Bonjour"
];

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

console.log(arr);array.push(element)const arr1 = [1,2,3]
const newValue = 4
const newData = [...arr1, obj] // [1,2,3,4]
Source

Also in JavaScript: