title: splice always delete last item from an array
body: <p>I tried a lot searching for, how to delete array item giving its index postion but in vain.
  Splice always remove last item from an array though I supply the index position of the item which needs to be deleted.(Here I know which index position of an item which is to be deleted. Following is my code.</p>
  
  <pre><code>//Array declaration and value assignment
  
    let a: Product = {} as any;
    a.id='E001';
    a.name='EarPhone';
    a.price='230$';
    a.qty='20';
    a.tax='10.222';
    a.total='2222.22';
    this.product.push(a);  //pushing data to product array
    a.id='E002';
    a.name='HeadPhone';
    a.price='230$';
    a.qty='20';
    a.tax='10.222';
    a.total='2222.22';
    this.product.push(a);
    a.id='E003';
    a.name='MicroPhone';
    a.price='230$';
    a.qty='20';
    a.tax='10.222';
    a.total='2222.22';
    this.product.push(a);
  
  /*   Required: Now i want to delete data in index position 1 that is 'E002', for which i have used slice function like this.
  */
  
  
  //code to delete array item of particular index
  void deletedItem()
  {
  //INDEX POSITION IS ONE HERE
  this.product.splice(indexPosition,1);
  }
  </code></pre>
  
  <p>But it always delete item in the last index that is product with id='E003';</p>
  
  <p>Note: The link below doesn't give the answer I am looking for
  <a href="https://stackoverflow.com/questions/46110228/angular-4-splice-always-deletes-last-element-from-array">angular 4 splice always deletes last element from array</a></p>