JavaScript Array [ ]
Example
Create an array:
let arr = [1, 2, 3]; //Create an array containing 1, 2, 3
arrOutput result:
1,2,3
Try it yourself »
Definition and Usage
[ ]The constructor creates a new array object.
Browser Support
![]()
![]()
![]()
![]()
![]()
Syntax
[iterable]
Parameters
| Parameters | Description |
|---|---|
| iterable | Required. An iterable object with values. |
Return Value
| Type | Description |
|---|---|
| Array object | Returns an array object. |
Other Extensions
JavaScript Array Object