Created
November 9, 2016 12:45
-
-
Save nikolovlazar/e91884f2e26fd3ef976738e4812ca834 to your computer and use it in GitHub Desktop.
zadacha recurzija
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 dragon(name, element, act) { | |
console.log(name + " spits " + element + " and " + act); | |
} | |
function curry(f, acc) { | |
acc = acc || []; | |
if(acc.length == f.length){ | |
f.apply(this, acc || []); | |
} else{ | |
return function(k){ | |
acc.push(k) | |
return curry(f, acc); | |
} | |
} | |
} | |
curry(dragon) ('Lazar')('O ino')('awrgqerg') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment