isNull
Using
This function determines whether the given value is exactly null
.
- Returns
true
only for thenull
literal. - Returns
false
for any other value, includingundefined
,false
,0
,""
,NaN
, objects, arrays, and other falsy types.
Demo - use JSON
isNull( )
true
Arguments
Argument | Type | Description | Example |
---|---|---|---|
value | unknown | Can be any type | "text" 2 undefined |
Returns
boolean
— true
if value is null
, false
otherwise
Examples
isNull(null);
// true
isNull(undefined);
// false
isNull(0);
// false
isNull('');
// false
isNull({});
// false
isNull(Object.create(null));
// false
isNull(() => null);
// false
Resources
📦 Since:1.3.0