Using Reduce Method Javascript Interview