Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

check either define or undefined in javascript

if (typeof variable !== 'undefined' || typeof variable ==='undefined') {
     //the variable is either defined or not defined 
  	 //in both conditions the code will be executed
}
 
PREVIOUS NEXT
Tagged: #check #define #undefined #javascript
ADD COMMENT
Topic
Name
3+3 =