Closed tmedwards closed 2 months ago
@tmedwards
And if the end-user did <<unset $towns>>
when $towns
contained an Object with properties that would cause the $towns
variable itself to be unset?
It will do exactly what it does now, completely remove the story variable regardless of its value.
The only difference the change to <<unset>>
will make is when doing something like <<unset $towns.adelaide>>
.
$towns
.adelaide
from the object contained within the story variable $towns
.
What it says on the tin.
Users attempting to use
<<unset>>
to delete properties from objects stored in story and temporary variables is a common issue. The two obvious solutions are:Option 2 is the clear choice here.
Example documentation
<<unset variableList>>
Unsets story $variables, temporary _variables, and properties of objects stored within either.
History:
v2.0.0
: Introduced.v2.37.0
: Added ability to unset object properties.Arguments:
variableList
: A list of story variables, temporary variables, or properties of objects stored within either.Examples:
Basic usage, unsetting story and temporary variables.
Unsetting object properties.