Array Prototype Reduce Javascript Function Definition Is Not Allowed