Just Enough Functional Programming In JavaScript > JS프레임워크

JS프레임워크

Just Enough Functional Programming In JavaScript 정보

기타 Just Enough Functional Programming In JavaScript

본문

https://egghead.io/lessons/javascript-course-introduction-to-just-enough-functional-programming-in-javascript

 

const withCount = fn => {
    let count = 0;

    return (...args) => {
        console.log(`Call coun: ${++count}`)
        return fn(...args)
    }
}

const add = (x, y) => x + y

 

const countedAdd = withCount(add)

 

console.log(countedAdd(1, 2))
console.log(countedAdd(2, 2))
console.log(countedAdd(3, 2))

 

정답은?

 

추천
0

댓글 0개

전체 261 |RSS
JS프레임워크 내용 검색

회원로그인

진행중 포인트경매

  1. 참여2 회 시작24.04.25 20:23 종료24.05.02 20:23
  2. 참여93 회 시작24.04.19 15:40 종료24.04.26 15:40
(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT