Last active
June 6, 2016 12:38
-
-
Save 5angel/197d2e05ceb6ec0c1f2d83b7362ebce9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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