What does this print?
void main() {
final xs = [7, 8, 6, 3];
final out = xs
.where((e) => e > 6)
.fold(0, (a, b) => a + b);
print(out);
}
Try it in the online Dart Playground →
[spoiler title="Solution"]
Answer:
15
Explanation:
where filters values and fold accumulates them into one sum.
[/spoiler]