Files
30-seconds-of-code/snippets/isString.md
2017-12-17 17:55:51 +02:00

12 lines
238 B
Markdown

### isString
Checks if the given argument is a string.
Use `typeof` to check if a value is classified as a string primitive.
```js
const isString = val => typeof val === 'string';
// isString(10) -> false
// isString('10') -> true
```