Hacker News new | ask | show | jobs
by nickstefan12 2641 days ago
I will never forget what I found when hacking the internals of Handsontable many years ago...

JavaScript For loops with

- :label (eg go to)

- continue

- break

It was definitely an interesting sperlunk!

2 comments

What’s so bad about continue and break? I’ve seen it in different languages in what I consider great projects...

Sometimes you really need an exit in the middle of the loop.

Worst part is, I've seen devs wrap their entire for-loop in an anonymous function JUST so they could use a return; to break out of the loop, instead of using break;
Nothing is particularly “bad”. I’ve used them in python a number of times.

I’m more just commenting that it’s a strange / interesting code based worth sight seeing. It was written in a style that seemed like from another language.

I remember that particular loop. It’s already gone.