I’ve got an array of objects defined like this:
var editionsObj = new Array();
function editionObject(name,description)
{
this.name = name;
this.description = description;
}
I need to search the editionsObj array for the existence of a variable in the name field. If no object in array has a name value equal to what I need, I’m going to insert it into the array. I’ve seen some examples in jQuery but wasn’t able to get any to work.
Thanks in advance!
Was able to solve this with code similar to the following:
Basically it performs a grep on the object array checking a certain index (name) for the value. If the value doesn’t exist, then I perform the add.
Hope it helps someone else!