Created
September 23, 2020 13:52
-
-
Save orhanveli/4e0a259015863a96b4956e769b4468d4 to your computer and use it in GitHub Desktop.
Write a sum method which will work properly when invoked using either syntax below.
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
console.log(sum(2,3)); // Outputs 5 | |
console.log(sum(2)(3)); // Outputs 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment