Created
June 6, 2019 21:15
-
-
Save servatj/e94b538fd67b85aeacb20d068b12e75c to your computer and use it in GitHub Desktop.
is Truthy in Javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const falsyValues = [undefined, null, 0, '', NaN] | |
const isTruthy = (value) => !falsyValues.includes(value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment