Js Reduce Return Array Php Push Into Array Java