Skip to content

Instantly share code, notes, and snippets.

@clintonhalpin
Last active October 23, 2017 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clintonhalpin/611153786d27c5b7d546bb47f5c4c8a3 to your computer and use it in GitHub Desktop.
Save clintonhalpin/611153786d27c5b7d546bb47f5c4c8a3 to your computer and use it in GitHub Desktop.
/**
* Code Golfing arrow functions
*/
// map with parens and brackets
arr.map((item) => { return item })
// Remove parens for args
arr.map(item => { return item })
// Replace {} with () for even shorter, no need for return statement
arr.map(item => ( item ))
// Even Less Strokes
arr.map(item => item)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment