Tag Archives: if condition not working when the value was ‘undefined’

How to handle ‘undefined’ in javascript

Variable ‘mydata’ is returning the value ‘undefined’, if you give this in an if condition its not working.. if(mydata==”undefined”) this condition should not work.so below code will solve the issue.