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