Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript check if undefined

let myVar;

if (myVar === undefined){}
  //!! Note: myVar == undefined would also check wether myVar is null 

//alternatively
if (typeof myVar === 'undefined'){ }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #check #undefined
ADD COMMENT
Topic
Name
1+3 =