Skip to content

Instantly share code, notes, and snippets.

@Chinecherem20199
Created May 16, 2022 11:24
Show Gist options
  • Save Chinecherem20199/2c69e91b19156309adac215f7b17cb00 to your computer and use it in GitHub Desktop.
Save Chinecherem20199/2c69e91b19156309adac215f7b17cb00 to your computer and use it in GitHub Desktop.
forEach_map_function
void main() {
final list = [10, 20, 33];
// for (var item in list) {
// print(item);
// }
//forEach
list.forEach((item) => print(item));
list.forEach(print);
//Map Function
var halves = list.map((value) => value / 2).toList();
for (var item in halves) {
print(item);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment