CONTAINSKEY


maps
Since v1.0.0
Available on all platforms
See also

The CONTAINSKEY function checks if the key element on top of the stack is a key of the map on second position.

The key is consumed, and a boolean is pushed on the stack.

Signature

Examples

{ 'foo' 42 'bar' true 'cool' 'always' } 'bar' CONTAINSKEY SWAP 'nok' CONTAINSKEY
{ 'key1' 'foo' 'key2' 'bar' 'key3' 'cool' } 'mymap' STORE <% $mymap 'key2' CONTAINSKEY SWAP DROP %> //keep only boolean result for conditional test <% 'key2 present, value = ' $mymap 'key2' GET + %> IFT //if then