Refactor peek function in Stack.

This commit is contained in:
Oleksii Trekhleb 2018-05-24 09:10:48 +03:00
parent c8b3fb9983
commit 114748b876

View File

@ -16,7 +16,7 @@ export default class Stack {
* @return {*}
*/
peek() {
if (!this.linkedList.tail) {
if (this.isEmpty()) {
return null;
}