-
Notifications
You must be signed in to change notification settings - Fork 183
Function binding #203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tarasyyyk
merged 9 commits into
javascript-tutorial:master
from
Vanchurick:function-binding
Sep 30, 2021
Merged
Function binding #203
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4f6e7e4
Function binding
Vanchurick 1aa9576
Function binding
Vanchurick 544c2b6
Function binding
Vanchurick b457b47
Update 1-js/06-advanced-functions/10-bind/2-write-to-object-after-bin…
tarasyyyk 53079cc
Update 1-js/06-advanced-functions/10-bind/2-write-to-object-after-bin…
tarasyyyk 4c3d8ab
Function binding
Vanchurick ee55e57
Merge branch 'function-binding' of https://github.com/Vanchurick/uk.j…
Vanchurick cf9db4e
Update 1-js/06-advanced-functions/10-bind/article.md
tarasyyyk c6870e3
Update 1-js/06-advanced-functions/10-bind/article.md
tarasyyyk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
1-js/06-advanced-functions/10-bind/2-write-to-object-after-bind/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
1-js/06-advanced-functions/10-bind/3-second-bind/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,15 @@ | ||
| The answer: **John**. | ||
| Відповідь: **Іван**. | ||
|
|
||
| ```js run no-beautify | ||
| function f() { | ||
| alert(this.name); | ||
| } | ||
|
|
||
| f = f.bind( {name: "John"} ).bind( {name: "Pete"} ); | ||
| f = f.bind( {name: "Іван"} ).bind( {name: "Христя"} ); | ||
|
|
||
| f(); // John | ||
| f(); // Іван | ||
| ``` | ||
|
|
||
| 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 creation time. | ||
| Екзотичний об'єкт [прив'язаної функції](https://tc39.github.io/ecma262/#sec-bound-function-exotic-objects) повертається від `f.bind(...)`, що запам'ятовує контекст (та аргументи, якщо передані) тільки під час створення. | ||
|
|
||
| A function cannot be re-bound. | ||
| Функція не може бути переприв'язана. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
1-js/06-advanced-functions/10-bind/4-function-property-after-bind/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| The answer: `undefined`. | ||
| Відповідь: `undefined`. | ||
|
|
||
| The result of `bind` is another object. It does not have the `test` property. | ||
| Результатом `bind` є інший об'єкт. Він не містить властивість `test`. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 9 additions & 9 deletions
18
1-js/06-advanced-functions/10-bind/5-question-use-bind/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.