check if object has any keys code example
Example 1: typescript check if object has key
if ('key' in myObj)
Example 2: check object has key javascript
Object.prototype.hasOwnProperty()
if ('key' in myObj)
Object.prototype.hasOwnProperty()