Declaring Arrays
4. Summary and References
Summary:
In summary,
- An array contains a data set represented by a single variable name. It can be use when you want to store a group or a list of related data in a single, easily controlled location.
- There are a few ways to create arrays in JavaScript:
- The most common is to use an array literal;
- Creating an empty array by using the syntax var name = [ ];
- Array() constructor method
References:
Sasha Vodnik and Don Gosselin(2015). JavaScript. In Sasha Vodnik and Don Gosselin (Sixth Edition), Building Arrays and Controlling Flow (147-211). Australia, Brazil, Mexico, Singapore, United Kingdom, United States, Cengage Learning
Array( ) Constructor: (n.d.). Retrieve from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Array
JavaScript Array – A Complete Guide for Beginners: (n.d.). Retrieve from https://data-flair.training/blogs/javascript-array/