Skip to content

Instantly share code, notes, and snippets.

@deleteman
Created July 16, 2019 19:07
Show Gist options
  • Save deleteman/3edd170f77d816e8e046de1493f8d749 to your computer and use it in GitHub Desktop.
Save deleteman/3edd170f77d816e8e046de1493f8d749 to your computer and use it in GitHub Desktop.
function isItDone(a) {
console.log("fn called!")
return a < 10
}
for(let a = 0; isItDone(a); a++) {
console.log(a)
}
/*
fn called!
0
fn called!
1
fn called!
2
fn called!
3
fn called!
4
fn called!
5
fn called!
6
fn called!
7
fn called!
8
fn called!
9
fn called!
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment