I have been trying to create one remove function to remove items from different array. My function is like this, which accepts array name and index of the item in that array.
removeItem(itemArray, index){
this.itemArray.splice(index,1);
}
Then use it like
removeItem('selectedColors',5);
But this
does not catch my variable name. In console I get this.itemArray .splice is not a function
I also tried like this, I created a itemArray variable so I could assign it. Well, did not work as well.
removeItem(itemArray, index){
this.itemArray = itemArray;
this.itemArray.splice(index,1);
}