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