JSON
Description
JSON Creation
Basic Syntax
// Simple object
data = {
name: "John",
age: 25 * 2, // Expressions are evaluated
items: ["a", "b", "c"]
}
// Object with computed values
multiplier = 10
obj = {
base: 5,
computed: self.base * multiplier, // References other properties
dynamic: "pre" ++ "fix" // String concatenation
}
// Object with methods
calculator = {
value: 100,
double: def() -> (
return self.value * 2
)
}Merging with ++
Type Support
Important Notes
Last updated