We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bebd5b1 + 43956f2 commit 6966ef9Copy full SHA for 6966ef9
object/find.js
@@ -1,4 +1,8 @@
1
import entries from "./entries.js";
2
3
-export default predicate => xs =>
4
- entries(xs).find(([key, value]) => predicate(value, key, xs));
+export default predicate => xs => {
+ const [, value] =
5
+ entries(xs).find(([key, value]) => predicate(value, key, xs)) || [];
6
+
7
+ return value;
8
+};
0 commit comments