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 without registration, duration hours minute second in high quality. This video was added by user Stral Tech 04 September 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 372 once and liked it 3 people.