Custom Exception Constructor
, that will be used to calculate the square root of a number, but throw an exception if the number is negative.
should take a single argument, the negative number passed to
, and should define an object that has two properties:
property should be set to the negative number passed in as an argument, and the
property should be set to the string 'Number must be positive'. Additionally, the
method of the object should return a string that concatenates the
properties, separated by a space.
should take a single argument, a number. If the number is negative, it should throw a
object with the value of the argument. If the number is positive, it should return the square root of the number using the