Comments (5)
Could we add
foo.call( obj2 ) // this === obj2
obj1.foo() // this === obj1
Also, could we not use the name foo
in different ways in this list (uncapitalized constructor function, method - key lookup in an object, a regular function, yada)?
from js-function-context-this.
Binding isn't a very good word here, either.
from js-function-context-this.
obj1.foo().call(someOtherObject)
That's an explicit binding, which is not what the quoted text is referring to.
Is the function called with a context (implicit binding)
I think the parenthetical is important. It should be a parenthetical.
I'm not sure when to re-emphasize that this
is not determined until the function is called. It's one of those things, like the definition of a callback, that I drill into them when I deliver this talk.
from js-function-context-this.
Yeah. I drilled it too. Maybe that has to be enough?
from js-function-context-this.
After discussing with @gaand, the example would be more appropriately shown as:
obj1.foo() // this === obj1
obj1.foo.call( obj2 ) // this === obj2
from js-function-context-this.
Related Issues (20)
- Change 2nd thatsNoMoon to endor HOT 1
- StarWars analogy pushed too far? HOT 4
- Constructor Invocation behaves differently in Chrome HOT 7
- In the summary HOT 1
- .age should be .handicap
- global_function.js - variables needs to be vars HOT 6
- Rework to follow `talk-template`? HOT 4
- Change event handlers to use jQuery HOT 4
- Review scope HOT 4
- Address `'use strict';` HOT 1
- Clarify `global` versus `window` ?
- Update all lab starter code to ES6 HOT 1
- Change golf handicaps
- Change formatting in README HOT 1
- Jquery is not loading properly HOT 1
- Remove code samples from README HOT 1
- Fix this link
- Simplify Global object and scope section
- Add objective or remove section from lesson
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-function-context-this.