Tag Archives: typeof to handle undefined javascript variable value

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.