Item deleter (mutable)
[data/dictionary/Item deleter (mutable)]
Deletes an item from the dictionary by its key. Mutates input. If the item is not found, the original dictionary is forwarded. Example A:
{ "first": 1, "third": 3, "fifth": 5 } @0 received via
dict
"first"@0 received via
key
dict
sends { "third": 3, "fifth": 5 }@0
Example B:
{ "first": 1, "third": 3, "fifth": 5 } @0 received via
dict
"second"@0 received via
key
dict
sends{ "first": 1, "third": 3, "fifth": 5 }@0
More: https://github.com/Cranq-io/cranq-tutorials/tree/main/reference/2_constructing_data/2_1_setters_deleters
Keywords: dictionary, dict, delete, remove, key, mutable
Input ports
dict:
{string: any}
Receives the dictionary to delete the item from. Example: { "first": 1, "third": 3, "fifth": 5 }
key:
string
Receives the key corresponding to the value to delete. Example: "third"
Output ports
dict:
any
Sends the resulting dictionary. Example: { "first": 1, "fifth": 5 }
Last updated