The language for programming web pages.
JavaScript uses try...catch...finally to handle runtime errors gracefully without crashing the program.
try...catch...finally
Use throw new Error("message") to throw custom errors.
throw new Error("message")
Edit the code below and click Run to see the result live.