var f = function fact(x)

{

if(x<=1) return 1;

else return x*fact(x-1);

};



이렇게 간단하게 재귀도 만들 수 있읍니다..