An array is a data structure that can hold multiple values of different types. We can create an array using the following methods:
The simplest way to create an array is by using array literal notation. Simply enclose the elements inside square brackets  and separate them with commas.
Another way to create an array is by using the Array constructor.
Declare a variable named
myArray and assign it an empty array (array literal, without any elements).
Sign up to start coding
Already have an account?