Sign In
Throw Custom Error
Beginner
Throw Custom Error
Create a function called
divideNumbers
that takes in two numbers and returns their quotient. If the second number is 0, throw a custom error object with the properties
name
set to
'DivideByZero'
and
message
set to
'Cannot divide by zero'
.
Click to go back
Click to go forward
Refresh preview
Console
Submit
Solution
00:00
Back to Exercises