Last updated 2 years ago
Was this helpful?
โฉ โฉ โฉ return
cannot use return in the body of a loop, except that the loop is inside a function.
( ๐ see: )
โ error: invalid outside of a func.
for n in 1...10 { if n == 3 { return } // โ error // ^^^^^^ // โ error: return invalid outside of a func }