Here, we will learn about a few basic array methods: push to add an item to the end of an array, unshift to add an item to the beginning, pop to remove an item from the end, and lastly shift to remove an item from the beginning. Additionally, we will learn about the length property, which gives us the length of an array. Since arrays are zero-indexed, we can use array.length - 1 to always find the position of the last item or array.length to add an item to the end of an array.
0:00 Introduction
0:20 Setting up an array
0:46 Getting the first item of an array
1:23 Getting the last item of an array
1:53 Using the length property
2:30 Getting the last item of an array using the length property
3:26 Push method to add items to the end of an array
4:55 Pushing multiple items to the end of an array
6:15 Unshift method to add items to the beginning of an array
7:32 pop method to remove items from the end of an array
9:52 shift method to remove items from the beginning of an array
10:36 creating a music playlist function
14:06 updating our music playlist function
JavaScript Playlist:
• JavaScript for Beginners
MDN Arrays:
https://developer.mozilla.org/en-US/d...
MDN Length Property:
https://developer.mozilla.org/en-US/d...
MDN Push Method:
https://developer.mozilla.org/en-US/d...
MDN Unshift Method:
https://developer.mozilla.org/en-US/d...
MDN Shift Method:
https://developer.mozilla.org/en-US/d...
MDN Pop Method:
https://developer.mozilla.org/en-US/d...
NodeJS:
nodejs.org
VS Code:
code.visualstudio.com
Sur cette page du site, vous pouvez voir la vidéo en ligne JavaScript for Beginners #32 Basic Array Methods & Properties | push() | unshift() | pop() | shift() durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur GreeneMath.com 04 février 2021, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 407 fois et il a aimé 13 téléspectateurs. Bon visionnage!