Skip to content

Commit

Permalink
Remove Utils.arrSubtract, as it is preffered to use `arr.filter((x) =…
Browse files Browse the repository at this point in the history
…> !otherArr.includes(x))` instead
  • Loading branch information
VeskeR committed Oct 25, 2024
1 parent fbf9d42 commit b73a15c
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/common/lib/util/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,6 @@ export function arrIntersectOb<K extends string>(arr: Array<K>, ob: Partial<Reco
return result;
}

export function arrSubtract<T>(arr1: Array<T>, arr2: Array<T>): Array<T> {
const result = [];
for (let i = 0; i < arr1.length; i++) {
const element = arr1[i];
if (arr2.indexOf(element) == -1) result.push(element);
}
return result;
}

export function arrDeleteValue<T>(arr: Array<T>, val: T): boolean {
const idx = arr.indexOf(val);
const res = idx != -1;
Expand Down

0 comments on commit b73a15c

Please sign in to comment.