Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js not equal to null

if (variable !== null) {
	//code
}

//Or, if you're expecting null as a string ('null'):

if (variable != null) {
	//code
}

//!== means not equal to, just like !=, but !== checks that the datatype is the same, whereas != doesn't.
//Example: (null !== "null") = true		(null != "null") = false
 
PREVIOUS NEXT
Tagged: #js #equal #null
ADD COMMENT
Topic
Name
2+9 =