Originally my question was How to Remove Object from jQuery array. < Found the answer, the one from @nnnnnn. Using $.grep
My new question now is how would you save the object that you just removed?
Reason is I wish to be able to push that saved Object back into the Array if the user decides to keep it.
My networks
array:
console:
networks array = [object Object],[object Object]
networks: Array[2]
0: Object
count: 1
id: "6"
label: "CompanyName"
type: "Organization"
1: Object
count: 1
id: "12622"
label: "MyGroup"
type: "Group"
From the other answer I'm using this to look in the networks array, find the Object with the type of "Organization" and remove it.
networks = $.grep(networks, function(o,i) { return o.type === "Organization"; }, true);
Is there a simple way to save that entire Object? So it can be pushed back in?
Thanks for taking a look!