mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
Update Util.js
This commit is contained in:
+4
-2
@@ -61,8 +61,10 @@ module.exports = class Util {
|
||||
}
|
||||
|
||||
static removeFromArray(arr, value) {
|
||||
const index = arr.indexOf(value);
|
||||
if (index > -1) return arr.splice(index, 1);
|
||||
while (arr.indexOf(value) > -1) {
|
||||
const index = arr.indexOf(value);
|
||||
arr = arr.splice(index, 1);
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user