What is the purpose of EvalError object

Posted by Jennifer | Updated on

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,


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers