Share your code. Components are building blocks, you are the architect.

array/first
v1.0.0
1.0.0
0.0.1
MIT
PUBLIC
3
0     DEPENDENCIES
Build: pass
BuildPass
Build Status: pass
Returns the first element of an array.
bit
Contributors
Gravatar for undefinedGravatar for undefined
1

Please configure Bit as a scoped registry to install components with NPM.Learn more

npm config set '@bit:registry' https://node.bitsrc.io
Use array/first in your project
npm i @bit/bit.utils.array.first
Copied

first (array:[]) : (* | null)

Returns the first element of an array.

Example

first([1, 2, 3]) // => 1
  first(['a', 'b', 'c']) // => 'a'

Argument

array: []

Returns

(* | null)

first element of given array

Test Summary


#first() should return `null` as array is emptyPass
#first() should return the first value of the arrayPass