3 ms·
> I'm most curious as to who uses the last argument in the JS map function! It's convenient for some things that would otherwise require a reduce (but where re
by dragonwriter 6y ago
> I'm most curious as to who uses the last argument in the JS map function!
It's convenient for some things that would otherwise require a reduce (but where reduce isn't particularly more efficient, because you just need lookahead/lookbehind) or an imperative loop, like transforming a list to a set of moving averages over the list.
It's a little more expressive than reduce our imperative lots
loops in those cases, too.