The value to check.
true if the value is a primitive type, otherwise false.
This function is specifically designed for checking primitive types. A primitive type is a type that is not an object or a function.
| Value | Type | Result |
|---|---|---|
null |
null |
true |
undefined |
undefined |
true |
'hello' |
string |
true |
123 |
number |
true |
123n |
bigint |
true |
true |
boolean |
true |
Symbol() |
symbol |
true |
[] |
array |
false |
{} |
object |
false |
function() {} |
function |
false |
Checks if a value is a primitive type.