Yeah, the example just shows the "even better" option: it gives a default value for the date parameter.
It's defined at the parameter level, using function parameter defaults
Re:Bad TypeScript Habits
by dbartholomae on Tuesday February 02, 2021 @03:18PM
(#26006054)
It uses a fallback at parameter level instead of the ?? operator.
oops indeed, but I'm not crazy there was a missing parathensis no? It's too late :D
Anyway great blog post
Re:Bad TypeScript Habits
by dbartholomae on Tuesday February 02, 2021 @03:30PM
(#26006201)
Yes, someone found the typo, send it to me via Twitter, and I fixed it. This is also where I know from that the article is on Hacker News :D
edit: read too fast :facepalm: