编辑代码

var MyQueue = function() {
    this.queueList = [];
    this.push = function(x){
        this.queueList.push(x)
    }
    this.pop = function(){
        let item = this.queueList.shift();
        return item;
    }
    this.peek = function() {
        let item = this.queueList[0];
        return item;
    };
    this.empty = function() {
        if(this.queueList.length){
            return false;
        }else{
            return true;
        }
    }
};