find.js 282 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 define(['./findIndex'], function (findIndex) { /** * Returns first item that matches criteria */ function find(arr, iterator, thisObj){ var idx = findIndex(arr, iterator, thisObj); return idx >= 0? arr[idx] : void(0); } return find; });