What happens when you throw an error in JavaScript?

When an error occurs, JavaScript will normally stop and generate an error message. The technical term for this is: JavaScript will throw an exception (throw an error) . JavaScript will actually create an Error object with two properties: name and message .
For More Information Please Refer:

You May Also Like to Read: