title: How to delete from an array javascript?
body: <p>My code below opens a random website from the array but to stop going on the same website is there a way to delete it once it has been visited. Heres my attempt.</p>
  
  <pre><code>&lt;button onclick="randomLink()";&gt;Click here to go somewhere else!&lt;/button&gt;
  
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  
  var randomLink = function () {
  
      var links = new Array(); 
          links[1] = "http://google.com";
          links[2]="http://bing.com";
  
      var max = (links.length)
  
  
      var randomNumber = Math.floor(Math.random()*max);
  
  
      var link = links[randomNumber];
  
      links.splice(randomNumber,1);
  
  
      $('iframe').attr('src', link);
  }
  &lt;/script&gt;
  
  &lt;iframe src="" name="iframe_a" &gt;&lt;/iframe&gt;
  </code></pre>