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