I have a array of arrays like the following:
myArray = [
["ooooh", "that"],
["dog ", "of"],
["mine", "word...."]
]
I now wish to delete the array item: ["ooooh", "that"]
Assuming that I know element 0 is "ooooh" and element 1 is "that", but i do not know the element's position within the enclosing array, can this be achieved efficiently?
The general responses from my research seem to be saying delete myArray['1'], or know the number of the element in the array- in my case in need both element 0 & 1 to match for removal.
In pseudo code i would like:
myArray.destroy(["ooooh", "that"])
How can this be achieved?
myList.splice(myList.findIndex(e => e[0] === "ooooh" && e[1] === "that"), 1);findIndexwill return-1if it does not exist, andsplicewill interpret that assplice(myList.length - 1, 1).