Skip to content

Instantly share code, notes, and snippets.

@gmilby
Created July 8, 2013 00:56
Show Gist options
  • Save gmilby/5945553 to your computer and use it in GitHub Desktop.
Save gmilby/5945553 to your computer and use it in GitHub Desktop.
underscore - find value by key
_.mixin({
findKeysByValue : function(object,value) {
var retVal=[]
for(var key in object){
var obj=object[key]
if(obj==value){
retVal.push(key)
}
}
return retVal;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment