Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

dart sum of list

int sum = [1, 2, 3].fold(0, (sum, current) => sum + current); // 6
int sum = [1, 2, 3].fold(0, (p, c) => p + c); // 6
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #dart #sum #list
ADD COMMENT
Topic
Name
1+3 =