Skip to content

Latest commit

 

History

History
19 lines (12 loc) · 660 Bytes

what_is_the_purpose_of_evalerror_object.md

File metadata and controls

19 lines (12 loc) · 660 Bytes

What is the purpose of EvalError object?

EvalError is an error object that is thrown when an issue occurs with the eval() function. It is rarely used today as eval() is generally avoided due to security concerns. The EvalError object provides information about errors related to code evaluation.

Example:

try {
  throw new EvalError('Eval error');
} catch (e) {
  console.log(e.message);  // Output: Eval error
}

Tags: intermediate, JavaScript, Error Handling