1 min readOct 17, 2017
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.