Basic JavaScript (43/111) | Manipulate Arrays With push | freeCodeCamp
An easy way to append data to the end of an array is via the push() function.
.push() takes one or more parameters and "pushes" them onto the end of the array.
Examples:
var arr1 = [1,2,3];
arr1.push(4);
// arr1 is now [1,2,3,4]
var arr2 = ["Stimpson", "J", "cat"];
arr2.push(["happy", "joy"]);
// arr2 now equals ["Stimpson", "J", "cat", ["happy", "joy"]]
Push ["dog", 3] onto the end of the myArray variable.
https://www.freecodecamp.org/learn/ja...
Watch video Basic JavaScript (43/111) | Manipulate Arrays With push | freeCodeCamp online, duration hours minute second in high quality that is uploaded to the channel Stral Tech 04 September 2020. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 372 times and liked it 3 visitors.