title: vs code terminal console not working with javascript
body: <p>so I installed the code runner extension and wanted to try javascript in vscode, to my suprise you cannot write in the output section so I switched to terminal. I right clicked my js file and chose 'open in integrated terminal', i wrote a snippet</p>
  <p><code>document.firstElementChild.lastElementChild.lastElementChild.lastElementChild.innerHTML = &quot;Angela&quot;;</code></p>
  <p>and the first thing it showed me was this:
  <a href="https://i.stack.imgur.com/MPPVK.png" rel="nofollow noreferrer">angela-error</a></p>
  <p>so I cleaned it and wrote another code i.e fizzBuzz. when I run <code>fizzBuzz();</code> it tells me</p>
  <blockquote>
  <p>An expression was expected after '('.
  + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
  + FullyQualifiedErrorId : ExpectedExpression</p>
  </blockquote>
  <p>i don't know wth that means.
  So then I tried This: <code>var heading = document.firstElementChild.lastElementChild.firstElementChild;</code> and when i call heading in the console this happens again: <a href="https://i.stack.imgur.com/5im2U.png" rel="nofollow noreferrer">heading-error</a></p>
  <p>my directory will be image 3. <a href="https://i.stack.imgur.com/DNdyL.png" rel="nofollow noreferrer">directory</a></p>
  <p>the code for fizzBuzz will also be here:</p>
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var output = [];
  var count = 1;
  
  function fizzBuzz() {
  
    while (count &lt;= 100) {
  
      if (count % 3 == 0 &amp;&amp; count % 5 == 0) {
        output.push("fizzBuzz");
      } else if (count % 3 == 0) {
        output.push("fizz");
      } else if (count % 5 == 0) {
        output.push("buzz");
      } else {
        output.push(count);
      }
      count++;
    }
    console.log(output);
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>h1 {
    color: red;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en" dir="ltr"&gt;
  
  &lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;title&gt;My Website&lt;/title&gt;
    &lt;link rel="stylesheet" href="styles.css"&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  
    &lt;h1&gt;Hello&lt;/h1&gt;
  
    &lt;input type="checkbox"&gt;
  
    &lt;button style="color: red" ;&gt;Click Me&lt;/button&gt;
  
    &lt;ul&gt;
      &lt;li class="list"&gt;
        &lt;a href="https://www.google.com"&gt;Google&lt;/a&gt;
      &lt;/li&gt;
      &lt;li class="list"&gt;Second&lt;/li&gt;
      &lt;li class="list"&gt;Third&lt;/li&gt;
    &lt;/ul&gt;
  
  
  
  
  
  
    &lt;script src="index.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>Please can someone help me with this. All of the above i tried in chrome console and it works. But i would love to work in vscode if possible.
  Also i know this is all messy so please forgive my messiness, amateur things you know!
  Thank you All.</p>