From the course: Learning the JavaScript Language
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Arrays - JavaScript Tutorial
From the course: Learning the JavaScript Language
Arrays
- [Instructor] In this video we're going to talk about arrays which are a way of storing lists of data that preserve their order. We've already looked at objects which let you group data together, but there are some cases where you want to store say a list of things, and the order of those things actually matters. For example, let's say you want it to store a list of the days of the week, which of course appear in a certain order, or the months of the year, something like that. In cases like those, you'll want to use an array. So how do we make one? Let's create a variable and call it myArray. And instead of using curly braces, as we did with objects, we use square braces like this. That is the form of an array literal. And so now if I check the value of my array, I get back those same empty square braces. If I wanted to create a list of days of the week, I'll just add those two square braces again and now I'll fill…
Contents
-
-
-
-
-
Objects4m 13s
-
(Locked)
Using objects for data modeling2m 33s
-
(Locked)
Manipulating objects4m 24s
-
(Locked)
Jargon: References4m 39s
-
(Locked)
Arrays5m 35s
-
(Locked)
Manipulating arrays7m 36s
-
(Locked)
Readability: Whitespace3m 24s
-
(Locked)
Readability: Comments4m 57s
-
(Locked)
Regular expressions6m 9s
-
-
-
-
-
-