Created
October 6, 2010 14:31
-
-
Save phiggins42/613435 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
dojo.filterObject = function(obj, filterFn, context){ | |
var ret = {}; context = context || window; | |
for(var i in obj){ | |
if(filterFn.call(context, obj[i], i, obj)){ | |
ret[i] = obj[i]; | |
} | |
} | |
return ret; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sorry... the link was to filterIn but i wrote forIn - i meant filterIn which works as you say, i blame jetlag :P