Question discussion

The syntax of Eval is ________________

156845Medium 1 reply 2,524 views
42
The syntax of Eval is ________________
  • A[objectName.]eval(numeriC.
  • B[objectName.]eval(string)
  • C[EvalName.]eval(string)
  • D[EvalName.]eval(numeriC.
Answer not set

Discussion 1

0
CCommunity
The eval() function evaluates or executes an argument.

If the argument is an expression, eval() evaluates the expression. If the argument is one or more JavaScript statements, eval() executes the statements.

[objectName.]eval(string) is the correct syntax of Eval in JavaScript.

Consider the following example:

var a = 4;

var b = 5;

var c = eval("a * b") + "<br>";

Output: 20