4 ms·
What usual misunderstanding of |this| are you referring to?
by simplify 10y ago
What usual misunderstanding of |this| are you referring to?
- dclowd9901 10y agoMight mean that in a module, `this` represents the environment the module was loaded in (rather than `undefined`), or `window|global` if not modularly loaded? I'm not sure either....
- olliej 10y agoPeople 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
- deleted 10y ago[deleted]