How to check if a object has a key / property in jvascript code example Example: typescript check if object has key if ('key' in myObj)