https://stackoverflow.com/questions/50098277/why-let-keyword-does-not-work-with-eval/50098375
why let keyword does not work with eval()
function foo(str, a) { eval( str ); console.log( a, b ); } foo( "var b = 3;", 1 ); This works just fine, but when we use let instead of var, it does not work. Why?
stackoverflow.com
'Programming > JavaScript' 카테고리의 다른 글
[EloquentJS] Ch7. Project: A Robot (0) | 2020.04.14 |
---|---|
[EloquentJS] Ch6. The Secret Life of Objects (0) | 2020.04.14 |
[EloquentJS] Ch5. Higher-order Functions (0) | 2020.04.14 |
new Function() vs. Function() (0) | 2020.03.12 |
[Eloquent JS] Ch3. Functions (0) | 2020.02.17 |