{"provider_name":"Hatena Blog","image_url":"https://images-fe.ssl-images-amazon.com/images/I/51ZoMJ%2BrLhL._SL160_.jpg","author_name":"kikiki-kiki","version":"1.0","width":"100%","title":"JavaScript eval vs. new Function","url":"https://chaika.hatenablog.com/entry/2019/05/02/120000","type":"rich","blog_title":"\u304b\u3082\u30e1\u30e2","published":"2019-05-02 12:00:00","blog_url":"https://chaika.hatenablog.com/","height":"190","categories":["JavaScript"],"description":"\u6587\u5b57\u5217\u3092\u305d\u306e\u307e\u307eJavaScript\u3068\u3057\u3066\u5b9f\u884c\u3067\u304d\u308b\u90aa\u60aa\u306a\u30d1\u30fc\u30c4\u3068\u3055\u308c\u308beval \u3068 new Function \u306e\u30e1\u30e2\u3002 node\u4f7f\u3063\u3066\u30e2\u30b8\u30e5\u30fc\u30eb\u5165\u308c\u3066Babel\u3057\u3066webpack\u3059\u308b\u6642\u4ee3\u306b\u4f7f\u3046\u4e8b\u306a\u3093\u3066\u306a\u3055\u305d\u3046\u3060\u3051\u3069\u3001\u3001\u3001 eval \u30b0\u30ed\u30fc\u30d0\u30eb\u30fb\u30b9\u30b3\u30fc\u30d7\u5185\u306b\u3042\u308b\u5909\u6570\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b let n = 3; (function() { let a = 'foo'; eval(\"console.log(a, n);\"); // 'foo', 3 // \u5909\u6570\u306e\u66f8\u304d\u63db\u3048 eval(\"a = 'bar'; n = 0;\"); console.log(a, n); // 'bar', 0 })(); con\u2026","author_url":"https://blog.hatena.ne.jp/kikiki-kiki/","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fchaika.hatenablog.com%2Fentry%2F2019%2F05%2F02%2F120000\" title=\"JavaScript eval vs. new Function - \u304b\u3082\u30e1\u30e2\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>"}