I think your giving a bad map reduce example. It is written in a very immature functional programming style.
It should be written like this, IMO:
var r = array
.map(square)
.reduce(sum, 0);
Differences:1. Separating out actions by line
2. Pass named functions that describe what they do