Answers for "adding values to arrays"

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
11

js push array

var array = [];
var element = "anything you want in the array";
array.push(element); // array = [ "anything you want in the array" ]
Posted by: Guest on April-25-2020
4

how to add objects in array java

car redCar = new Car("Red");
car Garage [] = new Car [100];
Garage[0] = redCar;
Posted by: Guest on February-13-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language