How to use eval in JavaScript
This article describe about eval() Function in JavaScript.
eval() Function in JavaScript
It is used to evaluates or executes an arguments.
Note: eval() also evaluates the expression if the expression is define in the argument, and argument may be one or more JavaScript statement.
Syntax
Parameter |
Descripton |
string |
Expression variable, or number of statement of JavaScript. |
Example
<!DOCTYPE html>
<html>
<body>
<script type="text/javascript">
eval("a=15;b=25;document.write(a*b)");
document.write("<br />" + eval("5+5"));
document.write("<br />" + eval(a + 250));
</script>
</body>
</html>
|
Output

You may also want to read these related articles Click here
Ask Your Question
Got a programming related question? You may want to post your question here
Programming Answers here