Created
August 2, 2016 18:00
-
-
Save VictorMedeiros/6fb613c6c4f54b7f646d398628b41f18 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 multiply(a, b) { | |
if (b === undefined) { | |
return function(b) { | |
return a * b; | |
} | |
} | |
return a * b; | |
} | |
let double = multiply(2); | |
double(3); // => 6 | |
multiply(2, 3); // => 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment