title: Uncaught TypeError: SpeechRecognition is not a constructor at app.js:5
body: <p>I'm coding a voice reconition assitant to make it work in my web page but I got this error: Uncaught TypeError: SpeechRecognition is not a constructor     at app.js:5(I'm using Google Chrome browser).</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const btn = document.querySelector('.talk');
  const content = document.querySelector('.content');
  
  const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechrecognition;
  const recognition = new SpeechRecognition(); 
  
  recognition.onstart = function() {
     console.log('Voice Is Activated, You Can Speak');
  };
  
  recognition.onresult = function(event) {
     console.log(event);
  };
  
  btn.addEventListener('click', () =&gt; {
     recognition.start();
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
     &lt;head&gt;
        &lt;meta charset="UTF-8"&gt;
        &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
        &lt;meta http-equiv="X-UA-Compatible" content="ie=edge"&gt;
        &lt;title&gt;MY ASSISTANT&lt;/title&gt;
     &lt;/head&gt;
     &lt;body&gt;
        &lt;h1&gt;Hello World&lt;/h1&gt;
        &lt;img src="#" alt=""&gt;&lt;/img&gt;
        &lt;button class="talk"&gt;Talk&lt;/button&gt;
        &lt;h1 class="content"&gt;&lt;/h1&gt;
  
        &lt;script src="app.js"&gt;&lt;/script&gt;
     &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>