Using Reduce Method Javascript Interview Preparation