News for hackers. Stuff that matters.
Re:Common combinators in JavaScript by wereHamster on Tuesday February 20, 2018 @12:05PM (#16421860)
Because it truly doesn't matter what 'x' is. It could be a number, string, an Array, Map, React Component, a very specific VerifiedUserWithBillingAddress object from your domain that you're working in right now.

So then what name do you want to give 'x' in `I = x => x`? Is `something` better, more readable?

If you write these functions ad-hoc in your modules as local helper functions, then by all means, use a more appropriate name:

    [1,2,3,undefined,6].map(anIntegerOrUndefined => anIntegerOrUndefined)
But the functions presented here are not those that you should have to write yourself. They are available in the Haskell base library, in JS you can import ramda or other packages. The important thing is to know how and when to use them.

There are no comments on this comment yet.