parent
21d9afebc3
commit
a9436306ab
2 changed files with 8 additions and 10 deletions
|
@ -18,6 +18,10 @@ export function erase<T>(x: T, xs: T[]): T[] {
|
|||
return xs.filter(y => x !== y);
|
||||
}
|
||||
|
||||
export function setDifference<T>(xs: T[], ys: T[]): T[] {
|
||||
return xs.filter(x => !ys.includes(x));
|
||||
}
|
||||
|
||||
export function unique<T>(xs: T[]): T[] {
|
||||
return [...new Set(xs)];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue