Skip to content

Commit

Permalink
hash example, some()
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Aug 27, 2010
1 parent 4fcece2 commit c7a133c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ function Hash (hash, extra) {
});
return acc;
},
some : function (f) {
for (var key in hash) {
if (f.call(self, hash[key], key)) return true;
}
return false;
},
update : function (h) {
Object.keys(h).forEach(function (key) {
hash[key] = h[key];
Expand All @@ -47,6 +53,7 @@ function Hash (hash, extra) {
tap : function (f) {
f.call(self, hash);
memoized = {};
return self;
},
end : hash,
items : hash
Expand Down

0 comments on commit c7a133c

Please sign in to comment.