Files
30-seconds-of-code/snippets/isString.md
Angelos Chalaris 7a2254e87e Resolve #754
2018-10-01 19:36:22 +03:00

256 B

isString

Checks if the given argument is a string. Only works for string primitives.

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

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