var a = function(x){
  if(x<=1) return 1;
  return x * arguments.callee(x-1)
}

a(1)//1
a(2)//2
a(3)//6
a(4)//24