Web Dev Roadmap for Beginners (Free!): https://bit.ly/DaveGrayWebDevRoadmap
An Introduction to Arrays in JavaScript that shows examples of how to create new arrays, modify array elements, and delete array elements as well as exploring examples of array methods and multidimensional arrays.
▶ This video is part of the JavaScript Tutorials for Beginners Playlist found here: https://www.youtube.com/playlist?list=PL0Zuz27SZ-6Oi6xNtL_fwCrwpuqylMsgT
Quick Concepts outline:
Arrays in Javascript
(00:00) Intro
(0:14) Arrays are Data Structures
(0:20) How to create an array
(1:00) How to add elements to an array
(2:00) Reference an array and view it in the console
(2:35) Length property of an array
(2:55) Reference the last element in an array
(3:55) Reference any item in an array by position
(4:20) Using the push() method to add elements to an array
(5:00) Using the pop() method to remove elements from an array
(6:00) Using the unshift() method to add elements to an array
(7:15) Using the shift() method to remove elements from an array
(8:15) Do the element positions change in the array?
(9:15) Referencing an element that does not exist
(9:35) How to remove an element from the middle of an array
(9:50) What happens when you delete an element from an array
(10:55) Using the splice() method to remove, replace, and insert elements
(13:45) The slice() method
(15:00) The reverse() method
(15:30) The join() method
(16:15) The split() method is a string method that creates a new array
(18:00) The concat() method
(18:55) Using the spread operator to combine arrays
(20:55) Multidimensional arrays / Nested arrays: Sports Store example
(21:45) Referencing an element in a single dimension array
(22:50) Referencing an element in a two dimensional array
(25:25) Referencing an element in a three dimensional array
Further Reading:
MDN Web Docs:
Arrays: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
Eloquent JavaScript Chapter 4:
https://eloquentjavascript.net/04_data.html
More Beginner JS Videos:
freeCodeCamp: https://youtu.be/PkZNo7MFNFg
Traversy Media: https://youtu.be/hdI2bqOjy3c
The Net Ninja: https://youtu.be/iWOYAxlnaww
Follow Me:
Twitter: https://twitter.com/yesdavidgray
Reddit: https://www.reddit.com/user/DaveOnEleven
Medium: https://medium.com/@davegray_86804
#arrays #javascript #tutorial