Remove Key From Map
101,044 Views
-
| | | | --- | --- | | | # Removes an element from the given map and returns a new map without that element | | | (Map:[keytype]valuetype where keytype:subtype(comparable), valuetype:type).RemoveKey(ElementToRemove:keytype):[keytype]valuetype= | | | var NewMap:[keytype]valuetype = map{} | | | for (Key -> Value : Map, Key <> ElementToRemove): | | | set NewMap = ConcatenateMaps(NewMap, map{Key => Value}) | | | return NewMap |Removes an element from the given map and returns a new map without that element
(Map:[keytype]valuetype where keytype:subtype(comparable), valuetype:type).RemoveKey(ElementToRemove:keytype):[keytype]valuetype= var NewMap:[keytype]valuetype = map{} for (Key -> Value : Map, Key <> ElementToRemove): set NewMap = ConcatenateMaps(NewMap, map{Key => Value}) return NewMap
Copy full snippet(6 lines long)
Categories:
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.