mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2025-07-04 08:02:19 +08:00
Use exist method to be consistent with Stack (#708)
This commit is contained in:
@ -21,7 +21,7 @@ export default class Queue {
|
||||
* @return {*}
|
||||
*/
|
||||
peek() {
|
||||
if (!this.linkedList.head) {
|
||||
if (this.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user