JavaScript Array [ ]
Example
Create an array:
let
arr
=
[
1
,
2
,
3
]
;
//
Create an array containing 1, 2, 3
arr Output result:
1,2,3
Try it »
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. |
JavaScript Array object