The eval() function is used to calculate a JavaScript string and execute it as script code. If the argument is an expression, the eval() function will execute the expression. If the argument is a Javascript statement, eval() will execute the Javascript statement.
Syntax
eval(string)
Parameters:
● string: required. A string to evaluate that contains a JavaScript expression to evaluate or a statement to execute.
Description:All major browsers support the eval() function
Example:
Output:
200 4 27
The above is the detailed content of What is the use of eval function in js. For more information, please follow other related articles on the PHP Chinese website!