break
Description
Will exit the loop (forLoop/whileLoop)
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 break
works.
Code Equivalent
Steps
Drag a
button
component into the canvas and open theAction
tab. Select thepress
event of the button and drag theforLoop
function to the event flow, add the value1
onstart
param and add the value9
onend
param.Drag the function
console
to theforLoop
function yes callback, on it'svalue
param change the param type to input.Drag the function
conditional
inside functionforLoop
yes callback, on paramcondition
change the param type to subflow/function. Inside paramcondition
subflow addequal
function then on it'svalue1
param change the param type to input and on it'svalue2
param add value5
.Drag the function
break
inside functionconditional
yes callback.Drag the function
console
after functionconditional
, add valuesome text
on it'svalue
param.
Result
Now click the button in preview, it will show the list current loop number along with
some text
five times on the console before thebreak
function stop the loop.
Links
Related Information
See also:
Functions
Last updated