SyntaxFix
Write A Post
Hire A Developer
Questions
you should pass reference on item in grep function:
function findPurpose(purposeName){ return $.grep(purposeObjects, function(item){ return item.purpose == purposeName; }); };
Example