Glia interview question

Create reduce JS function from scratch