@wtasnorg/node-lib / isPrimitive
isPrimitive(
val):boolean
Defined in: src/primitive.ts:22
Check whether a value is a JavaScript primitive
(null, boolean, number, string, symbol, bigint, or undefined).
unknown
The value to test.
boolean
true when val is a primitive.
isPrimitive(42); // true
isPrimitive("hello"); // true
isPrimitive({}); // false
isPrimitive(null); // true