How "reduce" works in JS?

An animation written using D3.js to illustrate how "reduce" works in JavaScript.