7 ms·
> - I thought JavaScript didn't have a `goto` statement? [I googled this to confirm it doesn't] Goto is not a statement. It's a function. Frameworks can have f
by DoesntMatter22 3y ago
> - I thought JavaScript didn't have a `goto` statement? [I googled this to confirm it doesn't]
Goto is not a statement. It's a function. Frameworks can have functions...
- chrismorgan 3y agoGoto is control flow. You can’t do control flow with function calls in the sorts of languages we’re talking about, so goto has to be built into the language, typically as a statement. (In some of these languages you can do awful hacks like using hooks intended for debuggers <https://entrian.com/goto/ https://entrian.com/goto/> or rewriting bytecode <https://github.com/snoack/python-goto https://github.com/snoack/python-goto>, and frankly what Svelte does is quite similar, just implemented as a compilation step rather than at runtime.)
- DoesntMatter22 3y agoI assumed this was talking about the goto statement in Svelte which is navigation method. If not that's fine