Polyfill: reduce( )

Transforms an array into a single value using a function in unsupported environments.

Asked in frontend interviews at PayPal, Amazon, ByteDance and 3 more