HAS

Returns true if the object or reference has a value with the specified key.

Syntax

=HAS(obj, key)

Arguments

ArgumentTypeDescription
objAnyThe object or reference to test
keyStringThe key to look for

Examples

=HAS(OBJECT("A", 1, "B", 2), "A")true
Tests whether an object with the key-value pairs "A" => 1, "B" => 2 has the key "A"

=HAS(OBJECT("A", 1, "B", 2), "C")false
Tests whether an object with the key-value pairs "A" => 1, "B" => 2 has the key "C"

=HAS(this, "Property 1)true
Tests whether the current shape has a property named "Property 1".

=HAS(this, "Property 2)false
Tests whether the current shape has a property named "Property 2".