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...
Смотрите видео Basic JavaScript (43/111) | Manipulate Arrays With push | freeCodeCamp онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Stral Tech 04 Сентябрь 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 372 раз и оно понравилось 3 людям.