Click here to Skip to main content
15,914,642 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
One of the object in my JavaScript code is showing that it has "No Properties" when I check it in JS Debugger of chrome. I want to apply if statement on it. How can I do that. Because
JavaScript
if (wsdl != null || wsdl != undefined || wsdl != NaN)


is not working
Posted
Comments
VishwaKL 17-Dec-12 5:28am    
http://stackoverflow.com/questions/3426979/javascript-checking-if-an-object-has-no-properties-or-if-a-map-associative-arra

http://stackoverflow.com/questions/2673121/how-to-check-if-object-has-any-properties-in-javascript



Check this links you may get an idea

1 solution

when an object is on of these
1: null
2: undefined
3: 0
4: ""
it is called falsy value
so you can do this
JavaScript
if(!wsdl){
    //do something
}

if you are not sure wsdl is declared so you can do this:
JavaScript
if(!window['wsdl']){
    //do something
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900