<p dir="auto">Challenge <a href="https://www.freecodecamp.com/en/challenges/basic-javascript/global-scope-and-functions" rel="nofollow">global-scope-and-functions</a> has an issue.<br>
User Agent is: <code class="notranslate">Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.101 Safari/537.36</code>.<br>
Please describe how to reproduce this issue, and include links to screenshots if possible.</p>
<p dir="auto">Even though I didn't use the "var" keyword in the code, it is not checking that item!!</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="

// Declare your variable here
var myGlobal = 10;

function fun1() {
// Assign 5 to oopsGlobal Here
oopsGlobal = 5;
}

// Only change code above this line
function fun2() {
var output = &quot;&quot;;
if (typeof myGlobal != &quot;undefined&quot;) {
  output += &quot;myGlobal: &quot; + myGlobal;
}
if (typeof oopsGlobal != &quot;undefined&quot;) {
  output += &quot; oopsGlobal: &quot; + oopsGlobal;
}
console.log(output);
}

    ```
"><pre class="notranslate"><span class="pl-c">// Declare your variable here</span>
<span class="pl-k">var</span> <span class="pl-s1">myGlobal</span> <span class="pl-c1">=</span> <span class="pl-c1">10</span><span class="pl-kos">;</span>

<span class="pl-k">function</span> <span class="pl-en">fun1</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-c">// Assign 5 to oopsGlobal Here</span>
<span class="pl-s1">oopsGlobal</span> <span class="pl-c1">=</span> <span class="pl-c1">5</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-c">// Only change code above this line</span>
<span class="pl-k">function</span> <span class="pl-en">fun2</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">var</span> <span class="pl-s1">output</span> <span class="pl-c1">=</span> <span class="pl-s">""</span><span class="pl-kos">;</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span> <span class="pl-s1">myGlobal</span> <span class="pl-c1">!=</span> <span class="pl-s">"undefined"</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-s1">output</span> <span class="pl-c1">+=</span> <span class="pl-s">"myGlobal: "</span> <span class="pl-c1">+</span> <span class="pl-s1">myGlobal</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span> <span class="pl-s1">oopsGlobal</span> <span class="pl-c1">!=</span> <span class="pl-s">"undefined"</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-s1">output</span> <span class="pl-c1">+=</span> <span class="pl-s">" oopsGlobal: "</span> <span class="pl-c1">+</span> <span class="pl-s1">oopsGlobal</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">output</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

    <span class="pl-s">``</span>`</pre></div>
<p dir="auto">Challenge <a href="https://www.freecodecamp.com/en/challenges/basic-javascript/global-scope-and-functions" rel="nofollow">global-scope-and-functions</a> has an issue.<br>
User Agent is: <code class="notranslate">Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.101 Safari/537.36</code>.<br>
Please describe how to reproduce this issue, and include links to screenshots if possible.</p>
<p dir="auto">Even though I didn't use the "var" keyword in the code, it is not checking that item!!</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="

// Declare your variable here
var myGlobal = 10;

function fun1() {
// Assign 5 to oopsGlobal Here
oopsGlobal = 5;
}

// Only change code above this line
function fun2() {
var output = &quot;&quot;;
if (typeof myGlobal != &quot;undefined&quot;) {
  output += &quot;myGlobal: &quot; + myGlobal;
}
if (typeof oopsGlobal != &quot;undefined&quot;) {
  output += &quot; oopsGlobal: &quot; + oopsGlobal;
}
console.log(output);
}

    ```
"><pre class="notranslate"><span class="pl-c">// Declare your variable here</span>
<span class="pl-k">var</span> <span class="pl-s1">myGlobal</span> <span class="pl-c1">=</span> <span class="pl-c1">10</span><span class="pl-kos">;</span>

<span class="pl-k">function</span> <span class="pl-en">fun1</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-c">// Assign 5 to oopsGlobal Here</span>
<span class="pl-s1">oopsGlobal</span> <span class="pl-c1">=</span> <span class="pl-c1">5</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-c">// Only change code above this line</span>
<span class="pl-k">function</span> <span class="pl-en">fun2</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">var</span> <span class="pl-s1">output</span> <span class="pl-c1">=</span> <span class="pl-s">""</span><span class="pl-kos">;</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span> <span class="pl-s1">myGlobal</span> <span class="pl-c1">!=</span> <span class="pl-s">"undefined"</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-s1">output</span> <span class="pl-c1">+=</span> <span class="pl-s">"myGlobal: "</span> <span class="pl-c1">+</span> <span class="pl-s1">myGlobal</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span> <span class="pl-s1">oopsGlobal</span> <span class="pl-c1">!=</span> <span class="pl-s">"undefined"</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-s1">output</span> <span class="pl-c1">+=</span> <span class="pl-s">" oopsGlobal: "</span> <span class="pl-c1">+</span> <span class="pl-s1">oopsGlobal</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">output</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

    <span class="pl-s">``</span>`</pre></div>