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
Walk the prototype chain of the target object using Object.getPrototypeOf in a while loop. At each step, compare the current prototype to Constructor.prototype. Return true on a match or false when the chain ends at null.
The instanceof operator checks if Constructor.prototype exists anywhere in the object prototype chain. Walking the chain with getPrototypeOf replicates this lookup exactly.
Updated Mar 2026