mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-12-26 07:01:18 +08:00
Use exist method to be consistent with Stack (#708)
This commit is contained in:
parent
d227646201
commit
8e8f28ffcf
@ -21,7 +21,7 @@ export default class Queue {
|
||||
* @return {*}
|
||||
*/
|
||||
peek() {
|
||||
if (!this.linkedList.head) {
|
||||
if (this.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user