Checks if value is specifically null.
Strict equality check for null values. More explicit than checking truthiness.
value to check
true if value is exactly null
isNull(null) // trueisNull(undefined) // falseisNull('') // falseisNull(0) // falseconst result = findUser(id);if (isNull(result)) { // User was explicitly not found} Copy
isNull(null) // trueisNull(undefined) // falseisNull('') // falseisNull(0) // falseconst result = findUser(id);if (isNull(result)) { // User was explicitly not found}
Checks if value is specifically null.
Strict equality check for null values. More explicit than checking truthiness.