replaced a for loop with call to Array.prototype.every

This commit is contained in:
Adam Piontek 2022-09-08 07:12:10 -04:00
parent 121cda7e3e
commit e3025aaf6c

View file

@ -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() {