Reduce Method In Javascript Array