Prototype-based Inheritance in JavaScript with Constructors using Object.create()

const object1 = {}; // Creates an empty object named object1 Object.defineProperties(object1, { // Defines properties on object1 property1: { // Defines property1 value: 142, // Assigns value 142 to property1 value: 422, // Overwrites previous value with 422 (only the last value assignment will be considered) value: 423, // Overwrites previous value with 423 (only the last value assignment will be considered) }, property2: {} // Defines property2 }); console.log(object1.property1); // Logs the value of property1 to the console

Output: