Lab

Prototype Chain

advanced
1/6

Step Explanation

Understand what is happening first

1/6

Execution Visualizer

Watch memory, stack, queues, and output

Execution Visualizer

live
Animal.prototype.speak is added to the Animal prototype object. All instances created with 'new Animal()' will share this method through the prototype chain.

Call Stack

1 frame
TOP ↑
main()
frame 0
↓ BOTTOM
Global Context

Memory

2 variables

Heap Memory

Animalfn→ refnew
"function"
Animal.prototypeobj→ refnew
"{ speak: fn }"
Console Output

awaiting output...

varfnobjarrclosure

Code Preview

Active line 1

Code

line 1
JavaScript
Tap Expand to view full code

1/6