Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
h1fra
· 5y ago · 0 comments
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:
Comments
[–]
jgwil2
5y ago
Yeah, the example just shows the "even better" option: it gives a default value for the date parameter.
[–]
_v7gu
5y ago
It's defined at the parameter level, using function parameter defaults
[–]
dbartholomae
5y ago
It uses a fallback at parameter level instead of the ?? operator.
[–]
h1fra
OP
5y ago
oops indeed, but I'm not crazy there was a missing parathensis no? It's too late :D
Anyway great blog post
[–]
dbartholomae
5y ago
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