I wonder about this!

Asked 2 years ago, Updated 2 years ago, 117 views



function foo(){
    console.log(this);
}

foo();

Why is this undefined??

vanillacoding javascript

2022-09-22 20:05

1 Answers

If a function is executed in a normal way, as in the example you wrote,

The running environment seems to be strict mode.


2022-09-22 20:05

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.