Shorthand for Object.create() with multiple properties
问题 If I want to create an object in JavaScript that has a prototype link to another object, but has several of it's own properties how can I do this? var object1 = { a: 1, b: 2 }; var object2 = Object.create( object1 ); object2.c = 3; object2.d = 4; console.log( object2 ); // my new object with object1 as it's prototype link My challenge here is that I have to set object2 's properties one at a time. My other option is: var object1 = { a: 1, b: 2 }; var object2 = { c: 3, d: 4 }; Object