Creates a new property on a thing. If the property already exists then the old
property will be overwritten. This function is equal to an assignment except that
it can be used when the name
of the property is dynamic.
This function generates a change.
thing.set(name, value)
Argument | Type | Description |
---|---|---|
name | str (required) | The name of the property to set. |
value | any (required) | The value which will be assigned to the property. |
The value which will be assigned.
This code shows how to use set():
[
.set('the_answer', 42),
.the_answer,
];
Return value in JSON format
[
42,
42
]