Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

What is the Difference between Undefined, undeclared, Null

What is the Difference between Undefined, undeclared, Null

// undefined means that the variable has not been declared, or has not been given a value.
// Undefined is used for unintentionally missing values.
var dog;
console.log(dog);


// Undeclared means the variable does not exist in the program at all.
console.log(cat);


// Null used for intentionally missing values. It contains no value.


 
PREVIOUS NEXT
Tagged: #What #Difference #Null
ADD COMMENT
Topic
Name
5+1 =