News for hackers. Stuff that matters.
Re:Fixing for Loops in Go 1.22 by Dylan16807 on Wednesday September 20, 2023 @01:34AM (#37580706)
> JavaScript (when using `var`)

I would argue that var is an entirely different issue. If variables last the entire function then it's far less confusing to see closures using the final value. After exiting the loop the final value is right there, still assigned to the variable. You can print it directly with no closures needed.

There are no comments on this comment yet.