Added isX functions
This commit is contained in:
9
snippets/is-function.md
Normal file
9
snippets/is-function.md
Normal file
@ -0,0 +1,9 @@
|
||||
### Is boolean
|
||||
|
||||
Use `typeof` to check if a value is classified as a function primitive.
|
||||
|
||||
```js
|
||||
const isFunction = val => val && typeof val === 'function';
|
||||
// isFunction('x') -> false
|
||||
// isFunction(x => x) -> true
|
||||
```
|
||||
Reference in New Issue
Block a user