Skip to content

Instantly share code, notes, and snippets.

@WaldoJeffers
Last active June 3, 2018 10:36
Show Gist options
  • Save WaldoJeffers/29602e99ea3a8a07c0c1a419b49fa71d to your computer and use it in GitHub Desktop.
Save WaldoJeffers/29602e99ea3a8a07c0c1a419b49fa71d to your computer and use it in GitHub Desktop.
const toObj = (key, value) => ({ [key]: value }) // toObj('hello', 'world) === { hello: 'world' }
const countOne = name => toObj(name, 1) // countOne('Tatooine') === { Tatooine: 1 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment