[JavaScript] Eigene Exceptions werfen

// https://www.w3schools.com/js/js_errors.asp
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error

try {
  throw new Error("Ein Error.");
  // throw new EvalError("Ein EvalError.");
  // throw new RangeError("Ein RangeError.");
  // throw new ReferenceError("Ein ReferenceError.");
  // throw new SyntaxError("Ein SytaxError.");
  // throw new TypeError("Ein TypeError.");
  // throw new URIError("Ein URIError.");
}
catch(e) {
  console.log(e);
}

Kommentare sind geschlossen.