Skip to content

Commit 114748b

Browse files
committedMay 24, 2018
Refactor peek function in Stack.
1 parent c8b3fb9 commit 114748b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/data-structures/stack/Stack.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default class Stack {
1616
* @return {*}
1717
*/
1818
peek() {
19-
if (!this.linkedList.tail) {
19+
if (this.isEmpty()) {
2020
return null;
2121
}
2222

0 commit comments

Comments
 (0)
Please sign in to comment.