Created
June 25, 2018 12:33
-
-
Save bendc/ea40569f84cbd4344fe8c106f55e5439 to your computer and use it in GitHub Desktop.
Unified object assignment
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 assign = (target, key, value) => | |
Object.assign(target, Object(key) === key ? key : {[key]: value}); |
Author
bendc
commented
Jun 25, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment