Adding Elements to Arrays with push in Javascript


Add items to the end of an array.

Source Code

let fruits = ["Apple", "Banana"];
fruits.push("Orange");
console.log(fruits); // ["Apple", "Banana", "Orange"]
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments