Last active
September 5, 2020 12:35
-
-
Save joelnet/eb96d0d9b09849fa6f08ccae4ef02216 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const renamed = ({ ID, ...object }) => ({ id: ID, ...object }) | |
const user = { | |
ID: 500, | |
name: "Bob Fossil" | |
} | |
renamed(user) //=> { id: 500, name: 'Bob Fossil' } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This gist is written for 7 Tricks with Resting and Spreading JavaScript Objects