4 ms·
I think the code sample after `Use the new ?? operator, or, even better, define the fallback right at the parameter level.` is not correct, it stops after new D
by h1fra 6y ago
I think the code sample after `Use the new ?? operator, or, even better, define the fallback right at the parameter level.` is not correct, it stops after new Date without any mention of ??
edit: read too fast :facepalm:
- dbartholomae 6y agoIt uses a fallback at parameter level instead of the ?? operator.
- h1fra 6y agooops indeed, but I'm not crazy there was a missing parathensis no? It's too late :D Anyway great blog post
- dbartholomae 6y agoYes, 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
- ulucs 6y agoIt's defined at the parameter level, using function parameter defaults
- jgwil2 6y agoYeah, the example just shows the "even better" option: it gives a default value for the date parameter.
- deleted 6y ago[deleted]