I am trying to remove a specific array from an array using the first items name.
For example:
myArray = [["human", "mammal"], ["shark", "fish"]];
I need to use the first item in this array to remove the array containing it.
Let's say I want to remove the array containing ['human', 'mammal']
.
How would I remove it using the first value 'human'
in that array?
Before I had a two dimensional array I was able to remove the specific item from the array using this code:
var removeItem = productArray.indexOf(valueLabel);
if (removeItem != -1) {
productArray.splice(removeItem, 1);
}
Obviously this method will not work anymore.