Hey Underscore, You're Doing It Wrong!
InfoQYouTube ↗
Caption notes
Brian Lonsdorf uses Underscore to discuss how argument order affects composition in a JavaScript library. In his odd-number example, he fixes the divisor first, then gives the resulting predicate to a filter to build a new function waiting for an array. A word-count example illustrates composition by splitting a string on spaces and then taking the length of the result. Finally, he uses Maybe to show how map applies the same transformation when a value is present and preserves the missing case otherwise.
Archived captions (transcription method unspecified) ↗Original passages · 2
keeps returning a new function until it gets all its argumentspassing the output of one function into the input of the next