262 B
262 B
title, tags
| title | tags |
|---|---|
| isSymbol | type,beginner |
Checks if the given argument is a symbol.
- Use
typeofto check if a value is classified as a symbol primitive.
const isSymbol = val => typeof val === 'symbol';
isSymbol(Symbol('x')); // true