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

why don`t judge the length of the second parameters #6

Open
ddddderek opened this issue Apr 20, 2018 · 3 comments
Open

why don`t judge the length of the second parameters #6

ddddderek opened this issue Apr 20, 2018 · 3 comments

Comments

@ddddderek
Copy link

When the length of the second parameters is greater than the length of the array,The undefined will be included in the result.

example:

 var last = require('array-last');

 var a = last(['a', 'b', 'c', 'd', 'e', 'f'],7);

result

[ undefined, 'a', 'b', 'c', 'd', 'e', 'f' ]
@ddddderek
Copy link
Author

suggest that the length of the first parameters as a loop condition or when the length of the second parameters is greater than the length of the array will return the array self

@jonschlinkert
Copy link
Owner

want to do a pr?

@ddddderek
Copy link
Author

I'm afraid I can't do it well

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

2 participants