I have a 2D array:
var array = [["a", "b", "c"],["a", "b", "c"],["a", "b", "c"]]
I want to delete an entire column of this array (i.e. delete every third element within each array).
There are solutions here and here, but neither of them is in javascript, so I'm having trouble relating the situations.
What's the best way to approach this problem? I don't want to use .splice() because in some cases I'll be deleting multiple columns, and the .splice() method will change the length of the array, so I end up accessing out of bounds.
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…