add string into array javascript code example
Example 1: pushing to an array
array = ["hello"]
array.push("world");
console.log(array);
//output =>
["hello", "world"]
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");