Last active
September 16, 2020 15:42
-
-
Save JamieDixon/51de02dbef17c3fb2f2d7847a5ef0855 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 sum(...args) { | |
function inner(...innerArgs) { | |
return sum(...args, ...innerArgs); | |
} | |
inner.valueOf = () => args.reduce((x, y) => x + y); | |
return inner; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment