Aryan PrajapatKnowledge Contributor
What is the purpose of EvalError object
What is the purpose of EvalError object
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Questions | Answers | Discussions | Knowledge sharing | Communities & more.
The EvalError object indicates an error regarding the global eval() function. Even though this exception is not thrown by JavaScript anymore, the EvalError object remains for compatibility. The syntax of this expression would be as below,
new EvalError([message[, fileName[, lineNumber]]])
You can throw EvalError with in try…catch block as below,
try {
throw new EvalError(‘Eval function error’, ‘someFile.js’, 100);
} catch (e) {
console.log(e.message, e.name, e.fileName);