JavaScript array data type

JavaScript array data type


JavaScript Array data type
In JavaScript, An Array is a non- primitive data type. You can store more than one element under a single name with the help of an array.
Ways to declare a single dimensional array:
// Call it with no arguments
var x = new Array();
 
// Call it with single numeric argument
var y = new Array(10);
 
// Explicitly specify two or
// more array elements
var z = new Array(1, 2, 3, "Hello World! Welcome to WDH.");
Example
Output