Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: typo fix: 优化表达 偏函数 -> 部分(应用)函数#1216

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
akfc58 wants to merge1 commit intojavascript-tutorial:master
base:master
Choose a base branch
Loading
fromakfc58:master
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@

现在它从外部变量中获得了 `user`,然后以常规方式运行它。

2. 或者从 `user.login`创建一个偏函数,该函数使用 `user` 作为上下文,并具有正确的第一个参数:
2. 或者从 `user.login`创建一个部分(应用)函数,该函数使用 `user` 作为上下文,并具有正确的第一个参数:


```js
Expand Down
4 changes: 2 additions & 2 deletions1-js/06-advanced-functions/10-bind/6-ask-partial/task.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,13 +2,13 @@ importance: 5

---

#偏函数在登录中的应用
#部分(应用)函数在登录中的应用

这个任务是比 <info:task/question-use-bind> 略微复杂的变体。

`user` 对象被修改了。现在不是两个函数 `loginOk/loginFail`,现在只有一个函数 `user.login(true/false)`。

在下面的代码中,我们应该向 `askPassword` 传入什么参数,以使得 `user.login(true)` 结果是 `ok`,`user.login(fasle)` 结果是 `fail`?
在下面的代码中,我们应该向 `askPassword` 传入什么参数,以使得 `user.login(true)` 结果是 `ok`,`user.login(false)` 结果是 `fail`?

```js
function askPassword(ok, fail) {
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp