Logo

Programming-Idioms

History of Idiom 7 > diff from v23 to v24

Edit summary for version 24 by :

Version 23

2015-08-22, 22:58:19

Version 24

2015-08-22, 22:59:46

Idiom #7 Iterate over list indexes and values

Print each index i with its value x from an array-like collection items

Idiom #7 Iterate over list indexes and values

Print each index i with its value x from an array-like collection items

Code
items.asMap().forEach((i, value) {
  print('index=$i, value=$value');
});
Code
items.asMap().forEach((i, value) {
  print('index=$i, value=$value');
});
Comments bubble
An alternative, but not really idiomatic.