title: Remove a range of elements from an array
body: <p>I want to remove a range of elements from an <code>array</code>:</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>var fruits = ["Banana", "Orange1", "Apple", "Banana", "Orange", "Banana", "Orange", "Mango", "Bananax", "Orangex"];
  var a = fruits.indexOf("Apple");
  var b = fruits.indexOf("Mango");
  
  var removedCars = fruits.splice(a, b);
  
  console.log(fruits);</code></pre>
  </div>
  </div>
  </p>
  
  <p>So I am expecting:</p>
  
  <pre><code>["Banana", "Orange1", "Bananax", "Orangex"]
  </code></pre>
  
  <p>But the result is:</p>
  
  <pre><code>["Banana", "Orange1", "Orangex"]
  </code></pre>
  
  <p>Why is this happening?</p>
  
  <p>Are there any faster and better ways of doing this?</p>