3 ms·
People keep trying to apply lexical scope for |this| when it is always the left hand of the function refernece expression, e.g. Lhs.foo() Lhs[foo]() And Foo
by olliej 10y ago
People keep trying to apply lexical scope for |this| when it is always the left hand of the function refernece expression, e.g.
Lhs.foo()
Lhs[foo]()
And
Foo() // where lhs is implied to be the scope object defining Foo
The last one seems to be what makes everyone super confused, but it is logically:
GetScopeWith("foo").foo()
Strict mode changes /one/ thing about|this|: whether the value of |this| undergoes object coercion