Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (47.6k points)

What's the best way of checking if an object property in JavaScript is undefined?

1 Answer

0 votes
by (106k points)

For detecting an undefined object property you can use the below-mentioned code:

if (typeof something === "undefined") {

alert("something is undefined");

}

Related questions

0 votes
1 answer
0 votes
1 answer
asked Aug 12, 2019 in Web Technology by Sammy (47.6k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...