Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
kangoo1707
· 7y ago · 0 comments
It doesn't have to be named, your second example still works
Comments
[–]
wbrasky
7y ago
naming anonymous functions can provide some clarity in stack traces however
[–]
SeanLuke
7y ago
I got the syntax right? Was completely guessing.
[–]
basil-rash
7y ago
Yep. Nowadays you'd be more likely to see it as:
return () => { const next = i; i = i * 2; return next; }
But in this case the two are equivalent.