/ Published in: JavaScript
                    
                                        
You can use if(!myVar) which will return True if a variable is undefined OR zero, but this method specifically checks for undefined.
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
if(typeof(myVar) == "undefined")
Comments
 Subscribe to comments
                    Subscribe to comments
                
                