Lab

The 'this' Keyword

medium
1/5

Step Explanation

Understand what is happening first

1/5

Execution Visualizer

Watch memory, stack, queues, and output

Execution Visualizer

live
The person object with name and two methods is created. 'this' inside a function is determined at call time, not at definition time — this is the key rule.

Call Stack

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

Memory

1 variable

Heap Memory

personobj→ refnew
"{ name, greet, greetArrow }"
Console Output

awaiting output...

varfnobjarrclosure

Code Preview

Active line 1

Code

line 1
JavaScript
Tap Expand to view full code

1/5