add string to array in javascript code example
Example 1: javascript pushing to an array
some_array = ["John", "Sally"];
some_array.push("Mike");
console.log(some_array); //output will be =>
["John", "Sally", "Mike"]
Example 2: how to push string into array in javascript
var arr = ["Hi","Hello","Bonjour"];
arr.push("Hola");
console.log(arr);
Example 3: javscript append item from array
let foo = ['oop','plop','copo'];
foo.push("plop");