Array constructors

Figure 18. ArrayConstructor

ArrayConstructor

Figure 19. Expr

Expr

The syntax for creating arrays is identical to that of JSON: square brackets, comma separated literals, object constructors and arrays constructors.

Example 27. Empty array constructors

[]
      

Result (run with Zorba): [ ]


Example 28. Array constructors

[ 1, 2, 3, 4, 5, 6 ]
      

Result (run with Zorba): [ 1, 2, 3, 4, 5, 6 ]


Example 29. Nested array constructors

[ "foo", 3.14, [ "Go", "Boldly", "When", "No", "Man", "Has", "Gone", "Before" ], { "foo" : "bar" }, true, false, null ]
      

Result (run with Zorba): [ "foo", 3.14, [ "Go", "Boldly", "When", "No", "Man", "Has", "Gone", "Before" ], { "foo" : "bar" }, true, false, null ]


Square brackets are mandatory. Do not push it.