I'm having trouble cycling through a multidimensional array and deleting a specific element array. My multidimensional array looks a little like this:
myArray = [["Tom", "161"], ["Dick", "29"], ["Harry", "46"]];
So if I have the number 29. What's the most efficient way to cycle through this array and delete the array element who's second element is 29? i.e. ["Dick", "29"]
forloop. Depending on what else you are doing with the data, you could sort the array first.indexOfwon't really work, since you are looking for an element inside the elements. But you can easily test what is faster with jsperf.com.