Files
30-seconds-of-code/snippets/isString.md
Angelos Chalaris 97c250bcfb Updated examples
2017-12-27 16:35:25 +02:00

243 B

isString

Checks if the given argument is a string.

Use typeof to check if a value is classified as a string primitive.

const isString = val => typeof val === 'string';
isString(10) // false
isString('10') // true