Answers for "how to push string into array in javascript"

3

how to push string into array in javascript

var arr = ["Hi","Hello","Bonjour"];
arr.push("Hola");
console.log(arr);
Posted by: Guest on January-18-2021
48

javascript pushing to an array

some_array = ["John", "Sally"];
some_array.push("Mike");

console.log(some_array); //output will be =>
["John", "Sally", "Mike"]
Posted by: Guest on November-12-2019
29

append array js

var colors= ["red","blue"];
	colors.push("yellow"); //["red","blue","yellow"]
Posted by: Guest on November-30-2019
8

js add item to array

const fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.push("Kiwi");
Posted by: Guest on June-10-2020
7

array.push

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 array
Posted by: Guest on May-02-2020

Code answers related to "how to push string into array in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language