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

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -