Created
March 27, 2018 03:04
-
-
Save kirkdotcam/167671e0d0eca2b33db503c9bf13baa6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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