continue
Description
Will continues to the next iteration of loop
Input / Parameter
N/A
Output
N/A
Callback
N/A
Example
In this example, we will do console logging by using console function in forLoop function callback to demonstrate how continue works.
Code Equivalent
for (let i = 1; i < 10; i++) {
console.log(i);
if (i == 8) {
// Continue to next iteration
continue;
}
console.log("some text")
}Steps
Drag a
buttoncomponent into the canvas and open theActiontab. Select thepressevent of the button and drag theforLoopfunction to the event flow, add the value1onstartparam and add the value9onendparam.
Drag the function
consoleto theforLoopfunction yes callback, on it'svalueparam change the param type to input.
Drag the function
conditionalinside functionforLoopyes callback, on paramconditionchange the param type to subflow/function. Inside paramconditionsubflow addequalfunction then on it'svalue1param change the param type to input and on it'svalue2param add value8.
Drag the function
continueinside functionconditionalyes callback.
Drag the function
consoleafter functionconditional, add valuesome texton it'svalueparam.
Result
Now click the button in preview, it will show the list current loop number followed with
some texton the console, notice that thecontinuefunction will ignore the 8thsome text.
Links
Related Information
See also:
Functions
Last updated