javascript - Detecting an undefined object property -




what's best way of checking if object property in javascript undefined?

use:

if (typeof === "undefined") {     alert("something undefined"); } 

if object variable have properties can use same thing this:

if (typeof my_obj.someproperties === "undefined"){     console.log('the property not available...'); // print console } 




wiki

Comments

Popular posts from this blog

elasticsearch - what is the equivalent data type for geo_point in hibernate search? -

firebase - How to wait value in Ionic 2 -

Jenkins: find build number for git commit -