The # of times I actually wanted to print "null" or "undefined" in javascript template strings: 0
If you prefer to replace "null" and "undefined" with empty strings check out https://www.npmjs.com/package/template-clean … For my use case (customer facing copy), I prefer to throw so issues are caught during testing. The ideal package throws during test/dev and passes empty strings in prod
-
-
Or, ya know, use a properly typed language
-
Typescript will save us all
-
So say we all
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.