isProp()function

isProp(obj: T, key: PropertyKey): key is keyof T
ParamType
objT
The object to test against. required
keyPropertyKey
The key to test for. required
Return
key is keyof T
true if key is an own prop of obj, narrowing its type.

Is an unknown value the key for an own prop of an object.