Added isX functions

This commit is contained in:
Angelos Chalaris
2017-12-14 12:56:02 +02:00
parent 6abffae5c4
commit 3aa0c5eec0
7 changed files with 100 additions and 18 deletions

9
snippets/is-string.md Normal file
View File

@ -0,0 +1,9 @@
### Is 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
```