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

Callable on map idiosyncratic #56

Open
dmeehan1968 opened this issue Apr 20, 2021 · 0 comments
Open

Callable on map idiosyncratic #56

dmeehan1968 opened this issue Apr 20, 2021 · 0 comments

Comments

@dmeehan1968
Copy link

map()s callable receives two arguments, the value and its index. This makes using standard library functions like trim and intval problematic without wrapping them in an anonymous or arrow function (because those functions have a second argument that alters behaviour).

It would be useful to have an alternative map() that does not supply the index. Without breaking the API this would need to be something like mapValue(), whereas it might have been preferable to have map() and mapWithIndex().

In part, the lack of documentation for each of Chain's methods, in regards to the Callable's parameters, doesn't help, without digging into the source.

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

1 participant