How to handle ‘undefined’ in javascript

By | November 2, 2015

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.