typescript check key is in object code example Example: typescript check if object has key if ('key' in myObj)