File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 1- ## Why Not to Use ` eval `
1+ ## なぜ、 ` eval ` を使ってはいけないのか
22
3- The ` eval ` function will execute a string of JavaScript code in the local scope.
3+ ` eval ` 関数はローカルスコープ中のJavaScriptコードの文字列を実行します。
44
55 var foo = 1;
66 function test() {
@@ -11,8 +11,7 @@ The `eval` function will execute a string of JavaScript code in the local scope.
1111 test(); // 3
1212 foo; // 1
1313
14- But ` eval ` only executes in local scope when it is being called ** directly** * and*
15- the name of the called function is actually ` eval ` .
14+ しかし、` eval ` は** 直接** ローカルスコープから呼ばれて、* かつ* 呼んだ関数の名前が実際の` eval ` でないと実行しません。
1615
1716 var foo = 1;
1817 function test() {
@@ -24,9 +23,8 @@ the name of the called function is actually `eval`.
2423 test(); // 2
2524 foo; // 3
2625
27- The use of ` eval ` should be avoided at ** all costs** . 99.9% of its "uses" can be
28- achieved ** without** it.
29-
26+ ` eval ` の使用は** 全てのコスト** を払ってでも回避するべきです。その「使用法」の99.9%で、これ** 無し** でも実装できます。
27+
3028### ` eval ` in Disguise
3129
3230The [ timeout functions] ( #other.timeouts ) ` setTimeout ` and ` setInterval ` can both
You can’t perform that action at this time.
0 commit comments