set->insert
Inserts a key into a set.
Target
Signature
1set->insert(key)Inserts a key into a set.
set->insert is called with member syntax on a receiver value. set->insert is useful when moving through groups of values. Prefer collection operations that match the shape of the data rather than converting everything to strings.
Parameters
key- Required value. Supply
keypositionally unless the signature shows a keyword form.
Examples
Basic call
1local(s) = set2#s->insert('a')The example shows the normal call shape. Adapt variable names, validation, and surrounding error handling to the context.