-2
[
   Object { column_name="a", id=0, name="Jack"},
   Object { column_name="b", id=1, name="rose1"},
   Object { column_name="c", id=2, name="rose2"},
   Object { column_name="d", id=3, name="rose3"},
   Object { column_name="e", id=4, name="rose4"},
]

Above the code my array of jQuery or JavaScript.

How to remove an array of any index from multi dimensional array with JavaScript or jQuery

Suppose i want to remove 3 number of array how to remove.

Piotr Dajlido
  • 1,887
  • 13
  • 26
Abid Hussain
  • 7,428
  • 2
  • 30
  • 49
  • 1
    Please try to rephrase your question. It is difficult to understand what you are trying to do. Do you want to remove the object at index 3? Also, where does jQuery come into the picture? – Mr. Polywhirl Mar 23 '15 at 14:16
  • 2
    how can you have +5k rep – Alex Mar 23 '15 at 14:17
  • 2
    possible duplicate of [Remove specific element from an array?](http://stackoverflow.com/questions/5767325/remove-specific-element-from-an-array) – Chris Pietschmann Mar 23 '15 at 14:17
  • And/or http://stackoverflow.com/questions/15287865/remove-array-element-based-on-object-property – T.J. Crowder Mar 23 '15 at 14:18

1 Answers1

3

See .splice() method.

var array = [
    Object { column_name="a", id=0, name="Jack"},
    Object { column_name="b", id=1, name="rose1"},
    Object { column_name="c", id=2, name="rose2"}
    Object { column_name="d", id=3, name="rose3"}
    Object { column_name="e", id=4, name="rose4"}
];
var indexToRemove = 3;
array.splice(indexToRemove, 1);
gabitzish
  • 9,137
  • 6
  • 42
  • 64