코드 :
function factorial(x) { if (x === 0) { return 1; } return x * factorial(x-1); } console.log(factorial(5));
결과 :
120 (= 5 x 4 x 3 x 2 x 1)
등록된 댓글이 없습니다.
코리아뉴스 2001 - , All right reserved. 더보기