Skip to content

Commit

Permalink
fix path (reverse)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuxodin committed Jun 30, 2022
1 parent 7a10a40 commit d78177f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tree1.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ export class tree extends HTMLElement {

path(){
if (this.isRoot()) return [this];
return [this].concat(this.parentNode.path()); // as we dont cache, we dont have to make a copy
// return this.isRoot() ? [this] : [...this.parentNode.path(), this];
return this.parentNode.path().concat(this);
// return this.isRoot() ? [this] : [...this.parentNode.path(), this]; // as we dont cache, we dont have to make a copy
}
}

Expand Down

0 comments on commit d78177f

Please sign in to comment.