Files
30-seconds-of-code/snippets/isSymbol.md
Angelos Chalaris 611729214a Snippet format update
To match the starter (for the migration)
2019-08-13 10:29:12 +03:00

16 lines
259 B
Markdown

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