<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>asakawajunya</author_name>
  <author_url>https://blog.hatena.ne.jp/asakawajunya/</author_url>
  <blog_title>asakawajunyaのブログ</blog_title>
  <blog_url>https://asakawajunya.hatenablog.com/</blog_url>
  <categories>
    <anon>javascript</anon>
    <anon>tips</anon>
  </categories>
  <description>オブジェクト指向JavaScriptという本を読んでいて、「へえ、そうなんだ」と思うところが有ったので。 JavaScriptのスコープはコードブロックではなく、関数スコープである 以下のコードを実行した場合、alertダイアログには1が表示される。 (function a() { if (true) { var b = 1; } alert(b); })(); Javaだとif文内で定義された変数はそこから出たら参照出来ないけど、JavaScriptはそんなことない。 参考 オブジェクト指向JavaScript作者: Stoyan Stefanov,水野貴明,渋川よしき出版社/メーカー: ア…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fasakawajunya.hatenablog.com%2Fentry%2F20120513%2F1336890926&quot; title=&quot; JavaScriptのスコープについて - asakawajunyaのブログ&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/51ttiBI82cL._SL160_.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2012-05-13 15:35:26</published>
  <title> JavaScriptのスコープについて</title>
  <type>rich</type>
  <url>https://asakawajunya.hatenablog.com/entry/20120513/1336890926</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
