function outside(x) {
function inside(y) {
return x + y;
}
return inside;
}
fn_inside = outside(3); // Think of it like: give me a function that adds 3 to whatever you give
// it
result = fn_inside(5); // returns 8
result1 = outside(3)(5); // returns 8
Last active
August 14, 2019 14:33
-
-
Save mamedinfo/c70ce9fb721265777ab493ddde28a304 to your computer and use it in GitHub Desktop.
Javascript
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment