Use Array#reduce to implement a simple version of Array#map.