How to check if a key or property exists in an object in JavaScript?
Originally posted here!
To check if a key exists in an object, you can use the in operator in JavaScript.
Let's say we have a person object like this,
// an object
const person = {
name: "John Doe",
age: 23,
isCustomer: true,
};
What if we wa...
melvingeorge-me.hashnode.dev2 min read