Skip to main content
Module

x/fun/array.ts>concat

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Go to Latest
function concat
import { concat } from "https://deno.land/x/fun@v.2.0.0-alpha.11/array.ts";

Given two arrays first and second, join them into a new array effectively doing [...first, ...second].

Examples

Example 1

import * as A from "./array.ts";
import { pipe } from "./fn.ts";

const result = pipe(
  A.range(3, 1),
  A.concat(A.range(3, 3, -1)),
); // [1, 2, 3, 3, 2, 1]

Parameters

second: ReadonlyArray<A>

Returns

(first: ReadonlyArray<A>) => ReadonlyArray<A>