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
Post a Comment