Package: effect
Module: Array
Splits an Iterable into two segments, with the first segment containing a maximum of n elements.
The value of n can be 0.
Example
import { Array } from "effect"
const result = Array.splitAt([1, 2, 3, 4, 5], 3)
console.log(result) // [[1, 2, 3], [4, 5]]
Signature
declare const splitAt: { (n: number): <A>(self: Iterable<A>) => [beforeIndex: Array<A>, fromIndex: Array<A>]; <A>(self: Iterable<A>, n: number): [beforeIndex: Array<A>, fromIndex: Array<A>]; }
Since v2.0.0