Created
May 19, 2018 16:30
-
-
Save khg0712/cc55a6ff87299abf4aabd2415f7e5d55 to your computer and use it in GitHub Desktop.
기명 함수 표현식 재귀함수 예시
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
var factorial = function factorialFunc(num) { | |
if(num <= 1) { | |
return num; | |
} | |
return (num * factorialFunc(num-1)); | |
}; | |
console.log(factorial(3));//6 반환 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment