From the course: JavaScript: Building Linked Lists Data Structures

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Arrays

Arrays

- [Instructor] In JavaScript, an array can be instantiated as a single variable that is used to store elements of differing data types. Instantiate is a fancy technical term for creating. When instantiating an array, you can declare a variable and assign its value. You can also use the new keyword. A great reference for ES2016's new operator is W3 schools documentation. Readability is important, so in this course, we will simply use the array literal method. Okay, so let's walk step by step through how to declare an array, assign its values, and reassign values as a refresher. So here we go. First, you will declare a variable that you can label anything you want. But for this example, let's say you label it arrOne. Second, you'll assign the variable a value, and here you can assign it the value of an array with three numbers. The values in this array will be four, five, and six. Third, to reassign the data to the array, you will simply type the variable and assign it the new value…

Contents