Sha256: b1cf455531188d551cd101edacaee8501ae47b626e8abfa933f3c724dc7c623f
Contents?: true
Size: 209 Bytes
Versions: 4
Compression:
Stored size: 209 Bytes
Contents
export function findIndex(array, fn) { for (let i = 0; i < array.length; i += 1) { if (fn(array[i], i)) return i; } return -1; } export function find(array, fn) { return array[findIndex(array, fn)]; }
Version data entries
4 entries across 4 versions & 1 rubygems