Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add more suggestions for _.first #312

Open
mrmowji opened this issue May 2, 2021 · 1 comment
Open

Add more suggestions for _.first #312

mrmowji opened this issue May 2, 2021 · 1 comment

Comments

@mrmowji
Copy link

mrmowji commented May 2, 2021

Currently, the suggestion we get for _.first might not be relevant in all cases. Array.prototype.slice() returns an array. But _.first from lodash returns a non-array value. So this line should be something like this I guess:

"alternative": "Array.prototype.slice() or arr[0]"

Also, I think we should add more aliases here. For example _.head should be prevented when _.first is prevented, because they're basically the same.

@KristjanTammekivi
Copy link

Also Array.prototype.at() or const [firstElement] = arr;

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants