JavaScript implementations of factorial calculation.