30 ms·
"map" and "reduce" are imperative; they order something done. Well, in JS, sure, but what about if you could do: a = 13 b = map(function(x){ return x; },
by icebraining 12y ago
"map" and "reduce" are imperative; they order something done.
Well, in JS, sure, but what about if you could do:
a = 13
b = map(function(x){ return x; }, [1, 2, 8, a])
print b
> [1, 2, 8, 13]
a = 26
print b
> [1, 2, 8, 26]
(While I'm representing it as a sequential program, the idea would be to plug "a" and "b" to some IO channels.)
What I'm trying to say is that the concept of map is not necessarily imperative, just JS's version.