Closed tester1101 closed 2 years ago
You can't use return right now. Escaping via ifs should usually suffice. The example seems very artificial, why would you check a boolean array? I think in general you should try to avoid doing big if-conditionals and instead use multiple closures in a reactive style. Add the code to be executed in the ifs in single closures, then add/remove them from a list dynamically. When the event happens simply execute all closures in the list (or only the first if execution shall stop after 1).
I want to use return in clousre like this.
[case 1]
This emits error in vscode.
But of cousre, [case 2]
I can write [case 1] like this, but this looks so nested.
If using return statement in closure is not allowed in wurstscript, is there other way to escape code?