<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>sightlas</author_name>
  <author_url>https://blog.hatena.ne.jp/sightlas/</author_url>
  <blog_title>javascriptのリアルゲーム投稿サイト　-sightlasの開発ブログ</blog_title>
  <blog_url>https://sightlas.hatenablog.com/</blog_url>
  <categories>
    <anon>javascriptについて</anon>
  </categories>
  <description>テストをしていて疑問に思ったのでメモ。 次のコードのようにJavaScriptでは、同じ名前の変数と関数を同じスコープに書くことができます。スコープが違う場合、最も近いスコープにある変数や関数が使われますが、同じスコープに同じ変数と関数がある場合はどうなのだろうと、テストしてみた。 コード： var a = 1; function a(){ } console.log(&quot;a:&quot; + a); function b(){ var b = 1; console.log(&quot;b:&quot; + b); } b(); (function(){ var c = 1; function c(){ } console.…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsightlas.hatenablog.com%2Fentry%2F2016%2F05%2F24%2F163509&quot; title=&quot;JavaScriptは、同じ名前の変数と関数が同じスコープにあった場合、常に変数が優先される - javascriptのリアルゲーム投稿サイト　-sightlasの開発ブログ&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>http://cdn-ak.f.st-hatena.com/images/fotolife/s/sightlas/20160524/20160524163030.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2016-05-24 16:35:09</published>
  <title>JavaScriptは、同じ名前の変数と関数が同じスコープにあった場合、常に変数が優先される</title>
  <type>rich</type>
  <url>https://sightlas.hatenablog.com/entry/2016/05/24/163509</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
