How To Use Reduce Method In Javascript