Files
30-seconds-of-code/snippets/isString.md
Angelos Chalaris 8281457945 Updated examples
Removed duplicate and unnecessary examples.
2018-01-04 14:22:56 +02:00

222 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'); // true