How to check if a key exists in a JavaScript object?
Hello everyone! I just started learning JavaScript and encountered a problem when working with objects. I have an object that contains user data:\n\n```javascript\nlet user = {\n name: "Ivan",\n age: 25,\n email: "ivan@example.com"\n};\n```\n\nI want to check if the key "phone" exists in this object before accessing it. If I just write `user.phone`, I get `undefined`, but what if in the future someone deliberately sets the value `undefined` for this key? How can I distinguish between a situation where the key does not exist at all and a situation where the key exists but its value is `undefined`?\n\nI tried several methods:\n1. `if (user.phone)` — doesn't work if the value is `false`, `0`, or an empty string.\n2. `if (user.phone !== undefined)` — also doesn't work if the value is explicitly equal to `undef