up
This commit is contained in:
parent
ab9ab64bd5
commit
97c8f22bbb
289 changed files with 195 additions and 172 deletions
15
1-js/06-advanced-functions/10-bind/3-second-bind/solution.md
Normal file
15
1-js/06-advanced-functions/10-bind/3-second-bind/solution.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
The answer: **John**.
|
||||
|
||||
```js run no-beautify
|
||||
function f() {
|
||||
alert(this.name);
|
||||
}
|
||||
|
||||
f = f.bind( {name: "John"} ).bind( {name: "Pete"} );
|
||||
|
||||
f(); // John
|
||||
```
|
||||
|
||||
The exotic [bound function](https://tc39.github.io/ecma262/#sec-bound-function-exotic-objects) object returned by `f.bind(...)` remembers the context (and arguments if provided) only at the creation time.
|
||||
|
||||
A function cannot be re-bound.
|
Loading…
Add table
Add a link
Reference in a new issue