Skip to content

Instantly share code, notes, and snippets.

@aruld
Created October 19, 2011 18:30
Show Gist options
  • Save aruld/1299218 to your computer and use it in GitHub Desktop.
Save aruld/1299218 to your computer and use it in GitHub Desktop.
Dart forEach() on a List/Set
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));
}
@yeicobF
Copy link

yeicobF commented May 13, 2021

Great!

@luigi-cuomo-3r
Copy link

Awesome!

@jfcompliasset
Copy link

We still use it in 2021, thanks man!

@icgoogo
Copy link

icgoogo commented Oct 7, 2021

i think we should avoid using set for variable name

@gulsenkeskin
Copy link

BIG thanks

@Shuusan
Copy link

Shuusan commented Feb 21, 2022

ありがとうございます!!!!!!!

@amirul12
Copy link

COOL

@GenaroGonzalezz
Copy link

Nice, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment