Scott: I agree completely about [1,2,3,4].map(‘x*x’) versus map(‘x*x’, [1,2,3,4]): I find the first more readable too. I didn't add these to Functional first because extending Array.prototype breaks associative array iteration. (See these postings by "Erik Arvidsson":http://erik.eae.net/archives/2005/06/06/22.13.54/, "James Mc Parlane":http://blog.metawrap.com/blog/WhyIDontUseThePrototypejsJavaScriptLibrary.aspx, and "davber":http://blog.davber.com/2006/08/24/prototype-arrays-improving-upon-ajax/). And second, because several of the DOM frameworks come with their own collection methods, and I didn't want to duplicate their work.

So, although I prefer [1,2,3,4].map(‘x*x’) myself and I'm willing to give up associative array iteration to get it, I didn't want to compile that tradeoff into this library.

Dean, thanks for the kind words --- I've enjoyed reading your code too. :-) I'll incorporate your improvement into the next version of the library.

Reply

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
13 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.