Returns a thing from a specified value, that may be dynamic. If no value is given, a new thing is returned.
This function does not generate a change.
thing([id])
Argument | Type | Description |
---|---|---|
id | int (optional) | The Id for the thing to return. |
Returns a thing. A lookup_err() is returned in case an Id is given which is not found inside the collection.
This code shows an example usage of thing():
.greet = "Hello world!";
[
thing(.id()),
thing(),
];
Example return value in JSON format
[
{
"#": 42,
"greet": "Hello world!"
},
{}
]