Skip to content
Subhajit Sahu edited this page May 5, 2020 · 1 revision

Get first character that satisfies the test, like Array.find().

const find = require('@extra-string/find');
// find(<string>, <testFn>, [thisArg])

find('badd0g', (v) => v>'f');
// 'g'
find('badcab', (v) => v>'f');
// undefined
find('', (v) => v>'f');
// undefined

extra-string

Clone this wiki locally