9 lines
219 B
JavaScript
9 lines
219 B
JavaScript
if (typeof(require) !== 'undefined') { var tree = exports }
|
|
|
|
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;
|
|
};
|