Agree, but cannot resist mentioning that JS actually does have control flow labels.

loop1: while (a < threshold1) {
a++
b = 0
loop2: while (b > threshold2) {
b--
if (a === b) break loop1
}
}

It’s as bad as (or worse than) any imperative code out there, and certainly not standard JS practice. You can only use labels with break or continue, so it’s not actually a GOTO. But it is very GOTO-like, especially in conjunction with continue.

Feel free to run screaming into the (purely functional) hills now.

Instructor at Fullstack Academy of Code. Passionate about functional programming, nihontō (traditional Japanese arms), and anything that combines art and tech.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Gabriel Lebec

Instructor at Fullstack Academy of Code. Passionate about functional programming, nihontō (traditional Japanese arms), and anything that combines art and tech.