Js Reduce Return Array Php W3schools