Joined December 2014
·

Sameer Kohli

United States
·
·

Posted to Scala fold, foldLeft, and foldRight over 1 year ago

val numbers = List(5, 4, 8, 6, 2); numbers.fold(0) { (z, i) => a + i }

should be

val numbers = List(5, 4, 8, 6, 2); numbers.fold(0) { (z, i) => z + i }

Achievements
1 Karma
0 Total ProTip Views