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
Auf dieser Seite können Sie das Online-Video JavaScript for Beginners #32 Basic Array Methods & Properties | push() | unshift() | pop() | shift() mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer GreeneMath.com 04 Februar 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 407 Mal angesehen und es wurde von 13 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!