Following are the ways to declare an Array in JavaScript
Table of Content
- Using Array Literal
- Using Array constructor
- Using new keyword
How to Declare an Array in JavaScript ?
In Javascript, Arrays can contain any type of data, numbers, strings, booleans, objects, etc. But typically all elements are of the same type.
Arrays can be single-dimensional with one level of elements, or multi-dimensional with nested arrays.
Contact Us