var factorial = function (n) {
var product = 1;
while (n) {
product *= n--
}
return product;
};
console.log(factorial(3));
var factorial = function (n) {
if (n) {
return n * arguments.callee(n - 1)
} else {
return 1
}
}
console.log(factorial(3));