Skip to content

Instantly share code, notes, and snippets.

@joelnet
Last active March 18, 2019 16:46
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 joelnet/0bdc3ea258ad0ddf12ebead62a808b0e to your computer and use it in GitHub Desktop.
Save joelnet/0bdc3ea258ad0ddf12ebead62a808b0e to your computer and use it in GitHub Desktop.
const user3 = {
password: 'Password!',
name: 'Naboo',
id: 300
}
const organize = object => ({ id: undefined, ...object })
// -------------
// /
// move id to the first property
organize(user3)
//=> { id: 300, password: 'Password!', name: 'Naboo' }
@joelnet
Copy link
Author

joelnet commented Mar 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment