HasProp.md

September 23, 2021 ยท View on GitHub

HasProp(Value, Name) returns whether Value has a property identified by Name. Value must not be a COM object.

If Value is a primitive (Number or String) type, it will examine the default base object.

It can recognize properties identified by objects.

This function is useful for validating interfaces for ad hoc polymorphism.

Examples

Object := {}

HasProp({}, "X")                ; 0
HasProp({"X": 1}, "X")          ; 1
HasProp(0, "base")              ; 1
HasProp({(Object): 1}, Object)  ; 1
HasProp({{}: 1}, Object)        ; 0