Code
Loading editor...
Tap Analyze to see visualization
Click Analyze to visualize
See step-by-step execution, variables, and output
Variables
Run code to see variables
Output
Console output will appear here
Click Analyze to visualize
See step-by-step execution, variables, and output
Run code to see variables
Console output will appear here
Replicate the four steps of the new operator: create a blank object with Object.create(Constructor.prototype), invoke the constructor with the new object as this via Constructor.apply(obj, args), and return the constructor result if it is an object, otherwise return the created object.
The new operator links the created object to the constructor prototype chain before calling the constructor. If the constructor returns a non-object, the newly created object is used instead.
Updated Feb 2026