Created
January 27, 2018 15:39
-
-
Save onelharrison/28dd64f41b5bf965f261517870c8206c to your computer and use it in GitHub Desktop.
Code snippet showing undefined being passed to the moment function.
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
function getDateString() { | |
let dateString; | |
// ... | |
// processing that sometimes resulted | |
// in dateString evaluating to undefined | |
return dateString; | |
} | |
const dateString = getDateString(); | |
moment(dateString); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment