replaced a for loop with call to Array.prototype.every
This commit is contained in:
parent
121cda7e3e
commit
e3025aaf6c
1 changed files with 1 additions and 4 deletions
|
@ -35,10 +35,7 @@ class Pyramid {
|
||||||
}
|
}
|
||||||
|
|
||||||
get isCleared() {
|
get isCleared() {
|
||||||
for (let i = 0; i < this.array.length; i++) {
|
return this.array.every((c) => c === 0);
|
||||||
if (this.array[i] !== 0) return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get freeCardIndices() {
|
get freeCardIndices() {
|
||||||
|
|
Loading…
Reference in a new issue