I’ve recently been looking at functional programming with Javascript, to which I’m a noob.
While writing some ‘map’, ‘reduce’ and ‘find’ functions I discover that as of JS version 1.5 these functions are already available (see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array)
I am however confused as next to these functions (i.e reduce) it says ‘requires javscript 1.8’ – but its in the 1.5 docs? How can this be ?
Also does anyone have a list, of all the major browsers, against which version of javascript they are running ?
If I wanted to use functional programming in my web project which approach should I be using ? Should I include a library of functions or can I rely on the browsers implementations ?
You won’t be able to rely on the built-in implementations of these methods unless you know your userbase is 100% firefox 3.
However, you can code your implementations with the idea that they might already exist, as seen in the docs