What does `scanLeft` do in Scala compared to `foldLeft`?
-
A
scanLeft only works on infinite lists
-
B
scanLeft returns all intermediate accumulator values, not just the final result
-
C
scanLeft is more efficient than foldLeft
-
D
scanLeft applies function in reverse