Skip to content

Instantly share code, notes, and snippets.

@haingdc
Created February 28, 2018 10:43
Show Gist options
  • Select an option

  • Save haingdc/4e2b9e9fc805158e9825816eaab257a2 to your computer and use it in GitHub Desktop.

Select an option

Save haingdc/4e2b9e9fc805158e9825816eaab257a2 to your computer and use it in GitHub Desktop.
A Gentle Introduction to Functional JavaScript: Part 2
var ids = ['unicorn', 'fairy', 'kitten'];
var getElement = function(id) {
return document.getElementById(id);
};
var elements = ids.map(getElement);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment