Skip to content

Instantly share code, notes, and snippets.

@andredublin
Last active May 17, 2016 00:08
Show Gist options
  • Save andredublin/d1908eb46349d310e7f3126a030730b8 to your computer and use it in GitHub Desktop.
Save andredublin/d1908eb46349d310e7f3126a030730b8 to your computer and use it in GitHub Desktop.
mapping fsharp
F#
let xs = List.map (fun x -> x * 2) [1; 2; 3; 4; 5]
C#
var xs = Enumerable.Range(1, 5).Select(x => x * 2)
JS
var xs = [1, 2, 3, 4, 5].map(function(x) { return x * 2 })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment