Created
March 27, 2018 02:54
-
-
Save kirkdotcam/bdabd97ca60fcd4abbcac69c551077ae 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.find = function(queryObj){ | |
return this.collection.find((element,index)=>{ | |
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