eval

IMPORTANT!  
Starting with v24.3, this is deprecated.

Runs JavaScript code represented as a string (evaluates expressions and executes statements). This allows you to run string contents not known in advance, such as when your code dynamically generates other code.

IMPORTANT!  
As the eval function executes string contents as code, it is a potential vector for cross-site scripting.

Syntax

function eval(x: string): any
 
Parameter Description
x String containing the JavaScript code to be run.

Return Value

Returns the result of the evaluation.

Examples