removed use of js Set

This commit is contained in:
Tim
2024-04-12 18:14:42 -04:00
parent 0084847d82
commit 71015656cd
2 changed files with 14 additions and 1 deletions

View File

@@ -218,3 +218,14 @@ export function lineColor(buy, index) {
return c.string()
}
export function unique(arr) {
const u = {}, a = [];
for(let i = 0, l = arr.length; i < l; ++i){
if(!u.hasOwnProperty(arr[i])) {
a.push(arr[i]);
u[arr[i]] = 1;
}
}
return a;
}