thing

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 an event.

Function

thing([id])

Arguments

Argument Type Description
id int (optional) The id for the thing to return.

Return value

Returns a thing. A lookup_err() is returned in case an id is given which is not found inside the collection.

Example

This code shows an example usage of thing():

.greet = "Hello world!";
[
    thing(.id()),
    thing(),
];

Example return value in JSON format

[
    {
        "#": 42,
        "greet": "Hello world!"
    },
    {}
]