Last active
January 24, 2018 12:40
-
-
Save jonaswide/70a945a8e7240d0537a23f241fb1a64f to your computer and use it in GitHub Desktop.
Revisions
-
jonaswide revised this gist
Jan 24, 2018 . No changes.There are no files selected for viewing
-
jonaswide revised this gist
Jan 24, 2018 . No changes.There are no files selected for viewing
-
jonaswide created this gist
Jan 24, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ export const addPropToObj = key => obj => val => ({ ...obj, [key]: val }) // Example const firstObj = { a: 1, b: 2, c: 3 } addPropToObj("d", firstObj, 4) // { a: 1, b: 2, c: 3, d: 4 }