concat

concat :: (A, A) -> A

description

Concatenate two elements of the same type: Arrays, Objects, Sets, Maps, Strings... without intentionally deduping elements: Arrays will be concatenated and may contain duplicates, Objects and Maps will be merged, and Sets will be concatenated without duplicates because Sets themselves can not contain duplicate elements.

circle-exclamation

examples

arrays

import { concat } from 'conductor'

const a = [1, 2]
const b = [2, 3]
concat(a, b) // [1, 2, 2, 3]

objects

import { concat } from 'conductor'

const a = { hello: 'Bonsoir', world: 'world' }
const b = { world: 'Elliot' }
concat(a, b) // { hello: 'Bonsoir, world: 'Elliot' }

strings

sets

Last updated