Share via


eval Method (JScript 5.6) 

Evaluates JScript code and executes it.


eval(codeString) 

Remarks

The required codeString argument is a string value that contains valid JScript code. This string is parsed by the JScript parser and executed.

The eval function allows dynamic execution of JScript source code. For example, the following code creates a new variable mydate that contains a Date object:


        eval("var mydate = new Date();");

The code passed to the eval method is executed in the same context as the call to the eval method.

Applies To: Global Object (JScript 5.6)

Requirements

Version 1

See Also

Reference

String Object (JScript 5.6)