Skip to content

Commit

Permalink
Use for-in in Object.filter
Browse files Browse the repository at this point in the history
  • Loading branch information
cpojer committed Apr 14, 2011
1 parent 4282287 commit 55a4e85
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/Types/Object.js
Expand Up @@ -39,9 +39,9 @@ Object.extend({

filter: function(object, fn, bind){
var results = {};
Object.each(object, function(value, key){
if (fn.call(bind, value, key, object)) results[key] = value;
});
for (var key in object){
if (fn.call(bind, object[key], key, object)) results[key] = object[key];
}
return results;
},

Expand Down

0 comments on commit 55a4e85

Please sign in to comment.