Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var foos = new List<int>{1,2,3,4};
var bars = new List<int>();
foreach(var foo in foos) {
Console.WriteLine("hello");
bars.Add(x*2);
}
// versus.
var bars = foos.Select(x => {Console.WriteLine("hello"); return x*2;});
Console.WriteLine("goodbye");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.