Skip to content

Instantly share code, notes, and snippets.

@kirkdotcam
Created March 27, 2018 03:04
Show Gist options
  • Save kirkdotcam/167671e0d0eca2b33db503c9bf13baa6 to your computer and use it in GitHub Desktop.
Save kirkdotcam/167671e0d0eca2b33db503c9bf13baa6 to your computer and use it in GitHub Desktop.
this.findAll = function(queryObj){
return this.collection.filter((element)=>{
let searchKey = Object.keys(queryObj)[0];
let searchValue = Object.values(queryObj)[0];
return element[searchKey] === searchValue;
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment