Skip to content

Instantly share code, notes, and snippets.

@chalin
Created November 10, 2017 15:14
Show Gist options
  • Save chalin/5d70bc1889d055c7a18d35d77874af88 to your computer and use it in GitHub Desktop.
Save chalin/5d70bc1889d055c7a18d35d77874af88 to your computer and use it in GitHub Desktop.
Language Tour: Anonymous Function
void main() {
var list = ['apples', 'bananas', 'oranges'];
list.forEach((item) {
print('${list.indexOf(item)}: $item');
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment