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 } 

Comments

Popular posts from this blog

Lists in Python -

android - can not access to progress bar in an other activity -

java - Vaadin 7 Pass Data Between Views -