You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.
oatkiller edited this page Sep 13, 2010
·
2 revisions
first_result iterates over an array or object, passing each element / property to a fn you provide. first_result returns the first truthy result from your fn.
first_result is similar to find. the difference is that find returns the element, and first_result returns the return of the fn
(function () {
// get a number
// returns 3
['blah','ducks','3','woot'][o.first_result](function (n) {
return parseFloat(n);
});
})();