Created
December 2, 2017 00:57
-
-
Save jethrolarson/99ca3c02c0f8c5de85b10843778a580c to your computer and use it in GitHub Desktop.
How moment.js parses falsy values
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
moment(0) // epoc | |
moment(undefined) // Now | |
moment(null) // Invalid Date | |
moment(false) // throw warning, Invalid date | |
moment(void 0) // Now | |
moment('') // Invlid Date | |
moment([]) // Now | |
moment({}) // Now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment