Created
April 18, 2017 07:27
-
-
Save anonymous/7c61901d15000bc80c3eaf464e6209ae 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