carto/lib/mess/tree.js
2011-01-05 14:23:28 -05:00

7 lines
174 B
JavaScript

require('mess/tree').find = function (obj, fun) {
for (var i = 0, r; i < obj.length; i++) {
if (r = fun.call(obj, obj[i])) { return r }
}
return null;
};