for (var i = 0; i < list.length; i++) {
print(list[i]);
}
main() {
List<String> list = new List<String>();
list.add('one');
list.add('two');
list.add('twelve');
list.forEach((element) => print(element));
Set<String> set = Set.from(list);
set.forEach((element) => print(element));
}
for (int i = 0; i < list.length; i++) {
print(list[i]);
}
Enhanced For loop
for(final e in li){
//
var currentElement = e;
}
List<int> ages = [29, 27, 42];
ages.forEach((int age) => print(age));