Javascript “not in” operator for checking object properties

try with below code

if(!('foo' in myObj)) { ... }
or
if(myObj['foo'] === undefined) { ... }

No comments:

Post a Comment