Answers for "javascript null not equal null"

7

javascript not null

if (variable !== null) {
  console.log("Var is NOT null");
}
Posted by: Guest on June-04-2020
1

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
Posted by: Guest on March-18-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language