(예시 코드)
function helloFunc(word) {
return function (name) {
console.log(`${word}, ${name}`);
};
}
const printHello = helloFunc("hello");
printHello("Tibetan Fox"); // hello, Tibetan Fox
printHello("Tiger"); // hello, Tiger
(커링 적용 후)
function helloFunc(word, name, word2, name2) {
console.log(`${word}, ${name} || ${word2}, ${name2}`);
}```
출처: https://ychcom.tistory.com/entry/%EA%B3%A0%EC%B0%A8%ED%95%A8%EC%88%98-Currying
출처: https://velog.io/@space086/React-Currying