Skip to content

Function: isSymbol() ​

ts
function isSymbol(value): value is symbol;

Checks whether a value is a symbol. 检查值是否为 symbol。

Parameters ​

ParameterTypeDescription
valueunknownThe value to check / 要检查的值

Returns ​

value is symbol

true when the value is a symbol / 值是 symbol 时返回 true

Example ​

ts
isSymbol(Symbol('s'))
// => true

Since ​

1.2.0

Released under the MIT License.