-
-
Save ckymn/8748ae4d56de4cb6233dc2600f8776ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shift() { | |
if (!this.head) return null; | |
let currentHead = this.head; | |
this.head = this.currentHead.next; | |
this.length--; | |
if(this.length === 0){ | |
this.tail = null; | |
} | |
return currentHead; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment