Created
April 7, 2021 22:24
-
-
Save RomanTurner/523862c7b5e68c82b9649e0ecf8cc75d to your computer and use it in GitHub Desktop.
Peek on LL for Stack
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
//Return the first element in the stack | |
peek = () => { | |
if(this.head){ | |
return this.head.element; | |
} | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment