What happens when using new with a constructor function in JavaScript?
When using the new operator to call a function (known as a constructor) in JavaScript, the following four key steps occur: 1. A new empty object is created The JavaScript engine first creates a brand-new empty object: 2. The new object’s prototype ([[Prototype]]) is set The internal prototype ([[Prototype]], accessible via __proto__ or Object.getPrototypeOf()) of