Skip to main content
isBoxedPrimitive - node__util--types.d.ts - Node documentation
function isBoxedPrimitive

Usage in Deno

```typescript import { isBoxedPrimitive } from "node:node__util--types.d.ts"; ```
isBoxedPrimitive(object: unknown): object is
String
| Number
| BigInt
| Boolean
| Symbol
Returns `true` if the value is any boxed primitive object, e.g. created by `new Boolean()`, `new String()` or `Object(Symbol())`. For example: ```js util.types.isBoxedPrimitive(false); // Returns false util.types.isBoxedPrimitive(new Boolean(false)); // Returns true util.types.isBoxedPrimitive(Symbol('foo')); // Returns false util.types.isBoxedPrimitive(Object(Symbol('foo'))); // Returns true util.types.isBoxedPrimitive(Object(BigInt(5))); // Returns true ```

Parameters

object: unknown

Return Type

object is
String
| Number
| BigInt
| Boolean
| Symbol