Hyperlinkv0.8.0-beta.28

Array

Array.lengthconsteffect/Array.ts:913
<A>(self: ReadonlyArray<A>): number

Returns the number of elements in a ReadonlyArray.

When to use

Use when you need length as a composable function rather than a property access.

Example (Getting the length)

import { Array } from "effect"

console.log(Array.length([1, 2, 3])) // 3
getters
Source effect/Array.ts:9131 lines
export const length = <A>(self: ReadonlyArray<A>): number => self.length