Skip to content

create array as set from two arrays. like as intersection, union, and defference set.

License

Notifications You must be signed in to change notification settings

MaxMEllon/array-set

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

array-set

create array as set from two arrays. like as intersection, union, and defference set.

Usage

const { intersection, union, difference } = require("array-set");

union([3, 2, 3], [2, 3, 4]);
// => [3, 2, 4]
intersection([1, 2, 3], [3, 4, 5]);
// => [3]
difference([1, 2, 3, 4], [1, 2]);
// => [3, 4]

API

intersection: <T extends string | numebr>(a: T[], b: T[]): T[]

union: <T extends string | numebr>(a: T[], b: T[]): T[]

difference: <T extends string | numebr>(a: T[], b: T[]): T[]

About

create array as set from two arrays. like as intersection, union, and defference set.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published