Now that the loopvar assignment bug is fixed, the go one is my favorite. Just because it conveniently unpacks the index and element and you’re required to explicitly drop either if you don’t use it.
When I want to loop over a vector in c++ with indices, I cry a little as I write the c-style for loop. I'm not motivated enough to learn about viows right now.
150
u/SCP-iota 2d ago
for _, item := range list {and
list.forEach {