Skip to content

Instantly share code, notes, and snippets.

@julesbou
Created March 11, 2016 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julesbou/ab297f9d40225310f4b8 to your computer and use it in GitHub Desktop.
Save julesbou/ab297f9d40225310f4b8 to your computer and use it in GitHub Desktop.
Backbone.Model.prototype.match = function(test) {
return _.any(this.attributes, function(attr) {
return _.isRegExp(test) ? test.test(attr) : attr == test;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment