Arrays
Arrays are mutable, ordered collections of values. All values in an array must have the same type. Arrays may contain a value multiple times. Array literals start with an opening square bracket [
and end with a closing square bracket ]
.
// An empty array
//
[]
// An array with integers
//
[1, 2, 3]
// Invalid: mixed types
//
[1, true, 2, false]
Last updated
Was this helpful?