Statements
throw statement
Terminates normal execution with a thrown value. No line terminator may separate throw and its expression.
Formal Syntax & Structure
javascript syntaxjavascript
throw expression;Working Example
Example Snippetjavascript
try { throw new Error("bad"); } catch(e) { console.log(e.message); }