Last active
August 29, 2015 14:26
-
-
Save kwalrath/7417291c1fd6c74b56be to your computer and use it in GitHub Desktop.
break_continue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool shutDownRequested() => true; | |
processIncomingRequests() {} | |
class Candidate { | |
var yearsExperience = 2; | |
interview() {} | |
} | |
main() { | |
while (true) { | |
if (shutDownRequested()) break; | |
processIncomingRequests(); | |
} | |
var candidates = [new Candidate(), new Candidate(), new Candidate()]; | |
for (int i = 0; i < candidates.length; i++) { | |
var candidate = candidates[i]; | |
if (candidate.yearsExperience < 5) { | |
continue; | |
} | |
candidate.interview(); | |
} | |
candidates.where((c) => c.yearsExperience >= 5) | |
.forEach((c) => c.interview()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment