use lastChild

This commit is contained in:
Ian Richardson 2019-11-15 11:10:47 -06:00
parent 89f33a1730
commit 562d7a7cf4

View File

@ -109,10 +109,8 @@ class EntityFilterBadge extends HTMLElement implements LovelaceBadge {
return; return;
} }
let child = this.lastElementChild; while (this.lastChild) {
while (child) { this.removeChild(this.lastChild);
this.removeChild(child);
child = this.lastElementChild;
} }
for (const element of this._elements) { for (const element of this._elements) {