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

实现 apply/call/bind | HZFE - 剑指前端 Offer #65

Open
utterances-bot opened this issue Jan 19, 2022 · 1 comment
Open

实现 apply/call/bind | HZFE - 剑指前端 Offer #65

utterances-bot opened this issue Jan 19, 2022 · 1 comment
Assignees

Comments

@utterances-bot
Copy link

实现 apply/call/bind | HZFE - 剑指前端 Offer

apply

https://febook.hzfe.org/awesome-interview/book4/coding-apply-call-bind

Copy link

zitup commented Jan 19, 2022

apply 这一行实现,会使第二个参数传入 []{length: 0} 时报错

if (argsArray && typeof argsArray === "object" && argsArray.length) {

可以改成

if (argsArray && typeof argsArray === "object" && 'length' in argsArray) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants