RosettaCodeData/Task/Factorial/Sidef/factorial-2.sidef

4 lines
67 B
Text
Raw Permalink Normal View History

2017-09-23 10:01:46 +02:00
func factorial_reduce(n) {
1..n -> reduce({|a,b| a * b }, 1)
}