Logo

Programming-Idioms

History of Idiom 7 > diff from v18 to v19

Edit summary for version 19 by :

Version 18

2015-08-21, 07:10:32

Version 19

2015-08-21, 08:40:45

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
for (var i = 0; i < items.length; i++) {
  print('index=$i, value=${items[i]}');
}
Demo URL
https://dartpad.dartlang.org/76313789b417c557a0ad