O'Reilly logo
  • shru ti thinks this is interesting:

When the if statement nested at lines 3–5 in the for...in statement (lines 2–8) detects that count is 5, the break statement at line 4 executes. This terminates the for...in statement, and the program proceeds to line 10. The loop fully executes its body only four times instead of 10.


Cover of Swift™ for Programmers


Once the break is encountered, loop will not execute further.