Home » JavaScript » JavaScript Functions » Question
  1. Consider the following code snippet :
    var Total=eval("5*5+10");
    1. 35 as an integer value
    2. 35 as a string
    3. Exception is thrown
    4. 5*5+10
    5. None of these
Correct Option: A

eval() is a function property of the global object. The argument of the eval() function is a string. If the string represents an expression, eval() evaluates the expression. If the argument represents one or more JavaScript statements, eval() evaluates the statements.



Your comments will be displayed only after manual approval.