JS terpecah di indeks

const splitAt = (index: number) => (x: string) => [x.slice(0, index), x.slice(index)]
florinrelea