I would like to pass a comparer into a function and not sure if this is possible with Javascript. There is an IComparer concept in C# that does this. Can this be done in Javascript?
function someAction (comparer) {
var newList = [];
$.each(list, function (index, item) {
if comparer on item is true then { //psuedo code
newList.push(item);
}
});
}
someAction(item.PropA > 5);