Lab

call, apply, and bind

medium
1/5

Step Explanation

Understand what is happening first

1/5

Execution Visualizer

Watch memory, stack, queues, and output

Execution Visualizer

live
call, apply, and bind all let you 'borrow' a function for any object. The object passed as first argument becomes 'this' inside the function.

Call Stack

empty

Call stack is empty

Memory

2 variables

Heap Memory

personobj→ refnew
"{ name: "Chitranjan" }"
greetfn→ refnew
"function"
Console Output

awaiting output...

varfnobjarrclosure

Code Preview

Active line 1

Code

line 1
JavaScript
Tap Expand to view full code

1/5