Skip to content

Instantly share code, notes, and snippets.

@mahmoud-samy
Created August 28, 2016 14:54
Show Gist options
  • Save mahmoud-samy/00b87757b331542271995f39fa258a65 to your computer and use it in GitHub Desktop.
Save mahmoud-samy/00b87757b331542271995f39fa258a65 to your computer and use it in GitHub Desktop.
// Write a sum method which will work properly when invoked using either syntax below.
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