Is there a way i can write the following piece of code to be more generic?
var result = $.grep(myObjectArray, function(e){
return e.Prop1 == 'SomeVal';
});
This is what i want to do.
A generic function that will accept myObjectArray (Object Array to filter), Prop1(Property name) and SomeVal (Value to filter) as an argument.
The problem i am facing is that i dont know how will i find the PropertyName in the object as it can be anything.
Any help will be highly appreciated.
Note the use of the square bracket syntax for object property access.