Girish Sapariya

Girish Sapariya

  • 1.8k
  • 239
  • 13.4k

Remove object from Collection using javascript/jquery

Aug 19 2014 1:26 AM
hi, I am having a collection like this:
 
var ColList = [ { ID: "1", Name: "Test1"}, { ID: "2", Name: "Test2"}, { ID: "3", Name: "Test3"}, { ID: "4", Name: "Test4"}]
 
I want to remove the object with value ID = 2 from ColList
just like we do in c# obj.Remove(obj1) or obj.RemoveAt(1) sort of.
 
How can this be achieve in javascript or jquery
 
 
and also  how can I add new obj in ColList
 
 
Thanks

Answers (1)