Skip to content

Commit

Permalink
Add new List#isCircular() class method
Browse files Browse the repository at this point in the history
  • Loading branch information
klaudiosinani committed Apr 1, 2019
1 parent 3e6f386 commit b5559fa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class List {
return this;
}

isCircular() {
return this.constructor.name === 'Circular';
}

isEmpty() {
return !this._head && this._length === 0;
}
Expand Down

0 comments on commit b5559fa

Please sign in to comment.