Skip to content

Instantly share code, notes, and snippets.

@khg0712
Created May 19, 2018 16:30
Show Gist options
  • Save khg0712/cc55a6ff87299abf4aabd2415f7e5d55 to your computer and use it in GitHub Desktop.
Save khg0712/cc55a6ff87299abf4aabd2415f7e5d55 to your computer and use it in GitHub Desktop.
기명 함수 표현식 재귀함수 예시
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