shiftLeft(data) {
    this.arr.push(data);

    if (this.arrayLength < this.arr.length) {
      this.arr.shift();
    }
  }
// while keeping the array of fixed length

while keeping the array of fixed length
while keeping the array of fixed length
shiftLeft(data) {
    this.arr.push(data);
    if (this.arrayLength < this.arr.length) {
      this.arr.shift();
    }
  }
shiftLeft ( data ) { this . arr . push ( data ) ; if ( this . arrayLength < this . arr . length ) { this . arr . shift ( ) ; } }
while keeping the array of fixed length
while keeping the array of fixed length