UNPKG
fj-find
Version:
latest (1.0.1)
1.0.1
1.0.0
find FP style.
github.com/fp-js/fj-find
fp-js/fj-find
fj-find
/
index.js
17 lines
(12 loc)
•
266 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"use strict"
;
var
curry2 =
require
(
"fj-curry"
).
curry2
;
var
find =
function
(
fn, list
) {
var
index = -
1
, listLen = list.
length
;
while
(++index < listLen) {
if
(
fn
(list[index])) {
return
list[index]; } } };
module
.
exports
=
curry2
(find);