pop() {
        if (this.isEmpty()) throw 'Queue Empty';

        this.frontIndex--;
        const obj = this.queue[this.frontIndex];
        this.time = obj.queueProperties.time;
        obj.queueProperties.inQueue = false;
        return obj;
    }
function to pop element from queue.