Queue in Javascript
To generate a Queue with FIFO:
const queue: number[] = [];
const QUEUE_MAX_LENGHT = 5;
this.queue.push(mmol);
if (this.queue.length > QUEUE_MAX_LENGTH) {
this.queue.shift();
}
To generate a Queue with FIFO:
const queue: number[] = [];
const QUEUE_MAX_LENGHT = 5;
this.queue.push(mmol);
if (this.queue.length > QUEUE_MAX_LENGTH) {
this.queue.shift();
}