[...] Did you ever use Haskell?Haskell is a functional programming language (you’ll soon see what it means), and now, there’s a library for Functional JavaScript.And that’s what you can do with it: instead of…var numbers = [2, 93, 8894, 491, 7]; var sum = 0; for( var i = 0; i < numbers.length; i++ ) { sum += numbers[i] * 20; alert(sum); You would just say:alert( reduce( 'x+y', 0, map('*20', [2,93,8894,491,7]) ) );Okay, while this is just some loosy nonsense example, the possibilities opened up by the library are huge. Still, the greatest benefits from Functional JavaScript are higher order functions: now, even Currying or partial function application are possible!Look here:// Create functions on the fly! var divide = 'x/y'.lambda(); // Apply only one parameter and create a new function. var halve = divide.partial(_,2); alert( halve(6) ); // "3"! So… This is really, really hot so far. What’s missing are good functions for working with lists (or even List comprehension). Also, I’d doubt that this has good performance. However, especially in web desing, while working with DOM or those things, I’m sure Functional JavaScript will find it’s place.Give it a try, it’s hot! (And use the "live demo feature" on the site linked above! ) [...]

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.
5 + 0 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.