Skip to content

xdash API Reference v0.5.14


xdash API Reference / hasOne

Function: hasOne()

hasOne(arr, fn): boolean

Defined in: src/array.ts:205

Checks if exactly one element in the array is truthy based on a callback function.

Parameters

arr

any[]

array to flatten

fn

(value, index, array) => boolean

callback to flatten the array

Returns

boolean

the flattened array

Released under the MIT License.