UNPKG

350 BJavaScriptView Raw
1/**
2 * Copyright (c) 2015-present, Facebook, Inc.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 * strict
8 */
9export default function find(list, predicate) {
10 for (var i = 0; i < list.length; i++) {
11 if (predicate(list[i])) {
12 return list[i];
13 }
14 }
15}
\No newline at end of file