Skip to content
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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff 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 deletions 1-js/06-advanced-functions/10-bind/6-ask-partial/task.md
Original file line number Diff line number Diff 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