7 ms·
It would be better if it compared JavaScript 1.8.2 to Haskell instead of plain ES3 + some library. Some JavaScript examples like the following would have been n
by TNO 17y ago
It would be better if it compared JavaScript 1.8.2 to Haskell instead of plain ES3 + some library. Some JavaScript examples like the following would have been nice:
#15:
function f(a, b) a + b;
#16:
function f(a){
function g(b){...}
return g(a);
};
#17:
function fib(n)
(n == 1 || n == 2) ? 1 :
fib(n-2) + fib(n-1);
#18:
(function(a) a + 1)(3)
#22:
[i + 1 for each(i in [1, 2, 3])]
#23:
[1, 2, 3, 4, 5][0]
[1, 2, 3, 4, 5][3]
#24:
function range(begin, end){
for (let i = begin; i < end + 1; ++i){
yield i;
}
};
[i for each(i in range(1, 10))];
#27:
function f(a)
function(b)
function(c)
a + b + c;
f(3)(5)(7);
etc...