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

4 lines
67 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
func factorial_reduce(n) {
1..n -> reduce({|a,b| a * b }, 1)
}