Added isX functions
This commit is contained in:
9
snippets/is-string.md
Normal file
9
snippets/is-string.md
Normal 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
|
||||
```
|
||||
Reference in New Issue
Block a user