title: How to UN-declare all non-function variables added via JavaScript console (without refreshing)
body: <p>Consider this - Say I went to console and wrote:</p>
  
  <pre><code>let x = 'y';
  </code></pre>
  
  <p>I then wrote again and got:</p>
  
  <pre><code>let x = 'y';
  </code></pre>
  
  <p>I'll get the:</p>
  
  <blockquote>
    <p>SyntaxError: redeclaration of let x</p>
  </blockquote>
  
  <p>Of course I've no intention to do so and it's just to describe how I get the error.</p>
  
  <p>Sometimes I copy whole code with variable redeclarations several times for <strong>testing</strong> purposes, and these codes contain code with variables already declared (even though I modified other parts of the code in a text editor before copying it). To overcome this I should refresh the browser.</p>
  
  <p>What could I write in console to no longer have this "redeclaration" error?</p>
  
  <p>I tried this which didn't help:</p>
  
  <pre><code>localStorage.clear();
  </code></pre>
  
  <p>In other words, how to UN-declare variables (<strong>which aren't functions</strong>) after I declared them in the JS console?</p>
  
  <hr>
  
  <p>The reason I ask this is comfortability --- I prefer to undeclare all variables without refreshing in most cases.</p>
  
  <p>This could be enuormosly comfortable when <strong>testing CSS injections</strong> as in this case (this way you don't get "redeclaration of <code>myCSS</code>):</p>
  
  <pre><code>// JS CODE TO UN-DECLARE ALL VARIABLES IN EACH NEW PASTE.
  
  // CODE WITH SAME VARIABLES AND CHANGES:
  let myCss =`
      .myclass1 {opacity: 1}
      .myclass2 {display: block}
  `;
  style = document.createElement("style");
  style.type = "text/css";
  style.styleSheet ? style.styleSheet.cssText = myCss : style.appendChild(document.createTextNode(myCss) );
  head = document.head || document.getElementsByTagName("head")[0];
  head.appendChild(style);
  </code></pre>