Created
April 29, 2016 20:23
-
-
Save easierbycode/3835fed7e58bec78718f95e071b60d21 to your computer and use it in GitHub Desktop.
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 characters
let a = {a:1}, b = {b:2}; | |
let target = {}; | |
// skips non-enumerable properties | |
Object.defineProperty(b, 'c', { | |
value: 3, | |
enumerable: false | |
}); | |
Object.assign(target, a, b); | |
console.log( b ); | |
// {b: 2, c: 3} | |
console.log( target ); | |
// {a: 1, b: 2} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment