diff --git a/snippets/isFunction.md b/snippets/isFunction.md index 5f0335225..e507bb9e5 100644 --- a/snippets/isFunction.md +++ b/snippets/isFunction.md @@ -5,10 +5,11 @@ Checks if the given argument is a function. Use `typeof` to check if a value is classified as a function primitive. ```js -const isFunction = val => val && typeof val === 'function'; +const isFunction = val => typeof val === 'function'; ``` ```js +isFunction(null); // false isFunction('x'); // false isFunction(x => x); // true ```