Skip to content

Conversation

@fisker
Copy link
Collaborator

@fisker fisker commented Jun 16, 2021

Fixes #974

--------------------------------------------------------------------------------␊
Suggestion 2/2: Use bound function.␊
1 | array.map(callback.bind(thisArgument))␊
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't auto-fix this case to use callback.bind, since it's not the best option, people may won't get attention with auto-fix.

@fisker fisker marked this pull request as ready for review June 16, 2021 09:01
@sindresorhus sindresorhus merged commit 96587f2 into sindresorhus:main Jun 17, 2021
@fisker fisker deleted the no-array-method-this-argument branch June 17, 2021 11:24
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

Successfully merging this pull request may close these issues.

Rule proposal: No this argument in array methods when using arrow functions

2 participants