Skip to content

Instantly share code, notes, and snippets.

@casprwang
Created January 5, 2017 21:25
Show Gist options
  • Save casprwang/f8b955cc67396350db0071c229d63493 to your computer and use it in GitHub Desktop.
Save casprwang/f8b955cc67396350db0071c229d63493 to your computer and use it in GitHub Desktop.
invoke a function by letting the function in
const a = x => console.log(x);
a(() => console.log('h1'));
// create a function on the fly
console.log(() => console.log('this is stupid'));
const b = x => x();
b(() => console.log('this is even stupier'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment