Skip to content

Instantly share code, notes, and snippets.

@christiantakle
Last active January 3, 2016 04:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christiantakle/8409518 to your computer and use it in GitHub Desktop.
Save christiantakle/8409518 to your computer and use it in GitHub Desktop.
A function that illustrates closures and higher-order functions in JavaScript
//-- If you understand closures - you know why this will always return true
function f(value) {
return (function (copy) {
return copy === value;
}(value));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment