Js Reduce Is Not A Function