there is a typo in the first exemple : numbers.fold(0) { (z, i) => a + i } should be numbers.fold(0) { (z, i) => z + i }.
The "a" variable doesn't exist.
there is a typo in the first exemple :
numbers.fold(0) { (z, i) => a + i } should be numbers.fold(0) { (z, i) => z + i }.
The "a" variable doesn't exist.