Numberdrome

Create the Numberdrome class with the following methods:

  • constructor(): initialization with the empty list of numbers;
  • addNumber(n): adds n to the list of numbers;
  • removeNumber(n): removes n from the list of numbers;
  • sum(): returns the sum of all the numbers in the list (0 if there are no numbers in the list);
  • product(): returns the product of all the numbers in the list (1 if there are no numbers in the list);
  • min(): returns the least number from the list or throws an error if there are no numbers;
  • max(): returns the largest number from the list or throws an error if there are no numbers.