Created
October 19, 2011 18:30
-
-
Save aruld/1299218 to your computer and use it in GitHub Desktop.
Dart forEach() on a List/Set
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | |
} |
You can use set.forEach(print)
instead of set.forEach((element) => print(element))
Great!
Awesome!
We still use it in 2021, thanks man!
i think we should avoid using set
for variable name
BIG thanks
ありがとうございます!!!!!!!
COOL
Nice, thanks a lot!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cool