-
Notifications
You must be signed in to change notification settings - Fork 118
Description
Is your feature request related to a problem? Please describe.
Currently, Blockly in the JavaScript adapter only offers a return
block with a condition (e.g. if ... return
).
If you want to return a value at an arbitrary point in the code, you always have to set the condition to true
, which leads to unnecessarily nested and visually messy blocks.
Describe the solution you'd like
Please add a new Blockly block like return <value>
without any condition.
This would directly correspond to a plain return <value>;
in JavaScript.
The current conditional return block can stay, but it should be complemented by this cleaner alternative.
Describe alternatives you've considered
The only workaround is using true
as the condition. While it works, it makes the Blockly code less readable and clutters the logic unnecessarily.
Additional context
Especially when working with more complex functions and multiple return paths, an unconditional return block would help keep the structure clean and improve code clarity.