Skip to content

Instantly share code, notes, and snippets.

@haingdc
Created March 13, 2018 04:51
Show Gist options
  • Save haingdc/3ba878533dad51ab5e637218954253f8 to your computer and use it in GitHub Desktop.
Save haingdc/3ba878533dad51ab5e637218954253f8 to your computer and use it in GitHub Desktop.
A Gentle Introduction to Functional JavaScript: Part 3
var numbers = [1, 2, 3];
var doubledArray = map(function(x) { return x * 2}, numbers);
console.log(doubledArray);
//=> [ 2, 4, 6 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment