Creating an Array with the literal constructor

suggest change

Arrays can be created by enclosing a list of elements in square brackets (\[ and \]). Array elements in this notation are separated with commas:

array = [1, 2, 3, 4]

Arrays can contain any kind of objects in any combination with no restrictions on type:

array = [1, 'b', nil, [3, 4]]

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents