Check if value is a character in JavaScript

How to check if a value is a character in JS?

I do not see the method Symbol.isSymbol(). My test (x instanceof Symbol)doesn't work either.

+4
source share
1 answer

Check it out with typeof:

typeof x === 'symbol'
+6
source

Source: https://habr.com/ru/post/1686592/


All Articles