Adobe interview question

Create a polyfill for array reduce