<A>(self: ReadonlyArray<A>): numberReturns 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])) // 3getters
Source effect/Array.ts:9131 lines
export const const length: <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
length = <function (type parameter) A in <A>(self: ReadonlyArray<A>): numberA>(self: readonly A[]self: interface ReadonlyArray<T>ReadonlyArray<function (type parameter) A in <A>(self: ReadonlyArray<A>): numberA>): number => self: readonly A[]self.globalThis.ReadonlyArray<A>.length: numberGets the length of the array. This is a number one higher than the highest element defined in an array.
length