Skip to content

Instantly share code, notes, and snippets.

@bendrucker
Created June 8, 2015 01:56
Show Gist options
  • Select an option

  • Save bendrucker/47eb40de58d2bb047ee2 to your computer and use it in GitHub Desktop.

Select an option

Save bendrucker/47eb40de58d2bb047ee2 to your computer and use it in GitHub Desktop.
Map
Array.prototype.map = function (callback, thisValue) {
return this.reduce(function (acc, item, index, array) {
return acc.concat(callback.call(thisValue, item, index, array)))
}, [])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment