eval(). See Never use eval()!, below.
importdeclarations (which can only exist in modules) are not allowed.
The completion value of evaluating the given code. If the completion value is empty,
undefined is returned. If
script is not a string primitive,
eval() returns the argument unchanged.
Throws any exception that occurs during evaluation of the code, including
script fails to be parsed as a script.
eval() is a function property of the global object.
The argument of the
eval() function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of
let is undefined), so it's recommended to not rely on statements' completion values.