array/first
v0.0.1
0.0.1
Collaborators
Gravatar for undefined
0
MIT
PUBLIC
0
0     DEPENDENCIES
BuildPass

Returns the first element of an array.

Use array/first in your project
npm i @bit/bit.utils.array.first

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