Does the eval () function create an execution context?

it is said that the eval () function creates an execution context, but also in non-strict mode?

"use strict";
var x = 1;
eval("var x = 2;");
console.log(x); // 12
Apr.05,2022

executing the eval function creates an execution context.
is just that the strict mode executes the eval function and does not act on its outer scope, so the modification x will not take effect.

Menu