5 ms·
in Scala the idiomatic way to sum is the method sum on collections List(1,2,3,4).sum Although this is indeed implemented with reduce. But is it really too much
by secdeal 3y ago
in Scala the idiomatic way to sum is the method sum on collections
List(1,2,3,4).sum
Although this is indeed implemented with reduce. But is it really too much code?
List(1,2,3).reduce(_ + _)