Reduce Method In Array Javascript Iteration Method