Skip to content

Instantly share code, notes, and snippets.

@luojiyin1987
Last active July 4, 2018 15:01
Show Gist options
  • Save luojiyin1987/9edf650507d96e12b1ebbd814a614d1d to your computer and use it in GitHub Desktop.
Save luojiyin1987/9edf650507d96e12b1ebbd814a614d1d to your computer and use it in GitHub Desktop.
#recurrence #callback
let syncFn = x => {
console.log("x is " + x);
if (x < 10) {
syncFn(x + 1);
console.log("x is " + x);
}
}
console.log('=== start sync ===');
syncFn(2);
console.log('=== end sync ===');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment