JavaScript: reduce() method ~> Array