Skip to content

Instantly share code, notes, and snippets.

@5angel
Last active June 6, 2016 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save 5angel/197d2e05ceb6ec0c1f2d83b7362ebce9 to your computer and use it in GitHub Desktop.
Save 5angel/197d2e05ceb6ec0c1f2d83b7362ebce9 to your computer and use it in GitHub Desktop.
function add(value) {
this.sum = this.sum || 0;
this.sum += value;
return add;
}
add.toString = () => this.sum;
console.log(add(2)(3) == 5); // true
console.log(add(2)(3) === 5); // false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment