Logo

Programming-Idioms

History of Idiom 54 > diff from v8 to v9

Edit summary for version 9 by :

Version 8

2015-08-22, 21:39:23

Version 9

2015-08-23, 10:53:27

Idiom #54 Compute sum of integers

Calculate the sum s of integer list x.

Idiom #54 Compute sum of integers

Calculate the sum s of integer list x.

Code
var s = x.fold(0, (a, b) => a + b);
Doc URL
https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:core.Iterable#id_fold