Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
12bitfloat10589135dNot entirely a goto since this still only allows structured control flow unlike real goto
But it's still a useful trick sometimes :D -
Lensflare19336135dWhat‘s even the point? If you really need goto for some low level crap, which is already very, very unlikely, you‘d probably not use JS but C.
What's the freaking use case? -
localpost4160135donly the second `continue label` here functions different from a plain continue, label2 is practically doing nothing
-
kiki37264135d@Demolishun there are complex algos that involve a lot of inner loops, and you know it. But why write them in JS in the first place when you have wasm
JS is a glue language -
12bitfloat10589135dBtw if you actually want to do this, use a do {} while(false) instead of a for, that way you don't have to remember to put a break at the end of each scope (for(;;) is an infinite loop)
-
kiki37264135d@Demolishun agree on all of the above. I do the same thing, but rn I'm mostly just using other people's wasm modules from github
ladies and gentlemen, goto in JS!
random