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
Create an empty constructor function F, set F.prototype to the desired proto object, then instantiate with new F(). This produces an object whose internal [[Prototype]] points to proto. Optionally apply property descriptors via Object.defineProperties for the second argument.
Setting F.prototype before calling new F() ensures the new object has the correct prototype link. This is the classic polyfill pattern used before Object.create was standardized in ES5.
Updated Mar 2026