Skip to content

isSymbol

Determine if a value is a Symbol

63 bytes

Usage

Pass in a value and get a boolean telling you if the value is a Symbol.

import * as
import _
_
from 'radashi'
import _
_
.
function isSymbol(value: unknown): value is symbol
export isSymbol

Checks if the given value is a symbol.

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

@example

isSymbol(Symbol('abc')) // => true
isSymbol('abc') // => false

@version12.1.0

isSymbol
('hello') // => false
import _
_
.
function isSymbol(value: unknown): value is symbol
export isSymbol

Checks if the given value is a symbol.

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

@example

isSymbol(Symbol('abc')) // => true
isSymbol('abc') // => false

@version12.1.0

isSymbol
(
var Symbol: SymbolConstructor
(description?: string | number) => symbol

Returns a new unique Symbol value.

@paramdescription Description of the new Symbol object.

Symbol
('hello')) // => true