08

Map but no reduce

qr-code for this page's url

Oh what a Javascript newbie I am…

I am currently reading "Learning jQuery Deferreds" and came across the (in my opinion a bit misnamed) synchronously function on page 27. It struck me as strange that this was coded in such an elaborate way rather than just using reduce as this was quite clearly a reduce on the array of tasks. Only after some searching the web did I see that jQuery does indeed not have a reduce function. (Javascript does, alas not universally as it was introduced with JS 1.8 and therefore not used in this book which tries to be univerally useful.)

It never occurred to me that jQuery was trying to be quite so minimalistic. Having a map function I had simply assumed that there'd also be a reduce.