Back
What's the best way of checking if an object property in JavaScript is undefined?
For detecting an undefined object property you can use the below-mentioned code:
if (typeof something === "undefined") {alert("something is undefined");}
if (typeof something === "undefined") {
alert("something is undefined");
}
31k questions
32.8k answers
501 comments
693 users