Ensure _.find returns undefinedwhen a value cannot be found. [closes #15]

Former-commit-id: e6dc89f98a1df81e1b1d67c5e8f5725e4df3bc5a
This commit is contained in:
John-David Dalton
2012-05-25 15:15:16 -04:00
parent f81ede2fd6
commit 8a5eb89aa8
2 changed files with 17 additions and 0 deletions

View File

@@ -585,6 +585,7 @@
* // => 2
*/
var find = createIterator(baseIteratorOptions, {
'init': '',
'inLoop': 'if (callback(collection[index], index, collection)) return collection[index]'
});