Skip to content

isPrimitive

Checks if the given value is primitive

97 bytes

Usage

Checks if the given value is primitive.

Primitive Types: number , string , boolean , symbol, bigint, undefined, null

import * as
import _
_
from 'radashi'
import _
_
.
function isPrimitive(value: any): boolean
export isPrimitive

Checks if the given value is primitive.

Primitive types include:

  • number
  • string
  • boolean
  • symbol
  • bigint
  • undefined
  • null

@seehttps://radashi.js.org/reference/typed/isPrimitive

@example

isPrimitive(0) // => true
isPrimitive(null) // => true
isPrimitive(undefined) // => true
isPrimitive('0') // => false

@version12.1.0

isPrimitive
(22) // => true
import _
_
.
function isPrimitive(value: any): boolean
export isPrimitive

Checks if the given value is primitive.

Primitive types include:

  • number
  • string
  • boolean
  • symbol
  • bigint
  • undefined
  • null

@seehttps://radashi.js.org/reference/typed/isPrimitive

@example

isPrimitive(0) // => true
isPrimitive(null) // => true
isPrimitive(undefined) // => true
isPrimitive('0') // => false

@version12.1.0

isPrimitive
('hello') // => true
import _
_
.
function isPrimitive(value: any): boolean
export isPrimitive

Checks if the given value is primitive.

Primitive types include:

  • number
  • string
  • boolean
  • symbol
  • bigint
  • undefined
  • null

@seehttps://radashi.js.org/reference/typed/isPrimitive

@example

isPrimitive(0) // => true
isPrimitive(null) // => true
isPrimitive(undefined) // => true
isPrimitive('0') // => false

@version12.1.0

isPrimitive
(['hello']) // => false