-
-
Save AliceWonderland/3ce9b63992578c46dc5d78a2612a4aa2 to your computer and use it in GitHub Desktop.
7.6 Partial created by smillaraaq - https://repl.it/HICV/7
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 partial(paramA, paramB){ | |
var resultA=paramA(paramB,0); | |
var resultB=paramB; | |
console.log(resultA, resultB); | |
var resultFunction=function(param){ | |
return resultA+param; | |
}; | |
return resultFunction; | |
} | |
var summer = function(a, b) { return a + b }; | |
var sumFive = partial(summer, 5); | |
sumFive(10) // => 15; | |
/* SCHOOL SOLUTION | |
function partial(fn, arg) { | |
return function(val) { | |
return fn(arg, val); | |
} | |
} | |
*/ | |
//did not finish bonus |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment