Making JavaScript Reduce: Example of Getting the Sum