title: "throw new Warning" in JavaScript?
body: <p>At the moment I'm extending my JavaScript project with error handling. The <code>throw</code> statement is playing an important role here:</p>
  
  <pre><code>throw new Error("text"); // Error: text
  </code></pre>
  
  <p>However, can I also throw a warning? I tried the following to no avail:</p>
  
  <pre><code>throw new Warning("text"); // Warning is not defined
  </code></pre>
  
  <p>The errors make Chrome's Developer Tools show a red cross, but how can I make it display a warning icon (yellow exclamation mark)?</p>