Foreach Loop
'foreach' is a looping attribute which is used to linearly iterate over String or List type values.
SRON provides 'foreach' attribute to work on foreach loop. To provide the value and the variable, 'on' attribue is used.
Syntax of 'on':
Examples:
Sample Code to iterate over list using foreach
OUTPUT :
0 1 2 3 true <#-Void-#> [91, 92, 93]
Sample code ot iterate over string using foreach
OUTPUT :
S R O N
Last updated