<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kikiki-kiki</author_name>
  <author_url>https://blog.hatena.ne.jp/kikiki-kiki/</author_url>
  <blog_title>かもメモ</blog_title>
  <blog_url>https://chaika.hatenablog.com/</blog_url>
  <categories>
    <anon>JavaScript</anon>
  </categories>
  <description>文字列をそのままJavaScriptとして実行できる邪悪なパーツとされるeval と new Function のメモ。 node使ってモジュール入れてBabelしてwebpackする時代に使う事なんてなさそうだけど、、、 eval グローバル・スコープ内にある変数にアクセスできる let n = 3; (function() { let a = 'foo'; eval(&quot;console.log(a, n);&quot;); // 'foo', 3 // 変数の書き換え eval(&quot;a = 'bar'; n = 0;&quot;); console.log(a, n); // 'bar', 0 })(); con…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fchaika.hatenablog.com%2Fentry%2F2019%2F05%2F02%2F120000&quot; title=&quot;JavaScript eval vs. new Function - かもメモ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://images-fe.ssl-images-amazon.com/images/I/51ZoMJ%2BrLhL._SL160_.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-05-02 12:00:00</published>
  <title>JavaScript eval vs. new Function</title>
  <type>rich</type>
  <url>https://chaika.hatenablog.com/entry/2019/05/02/120000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
