pop() {
    if (this.length === 0) {
      throw new Error("Invalid operation on an empty array.");
    }
    this.deleteItemAndUpdateLength(this.length - 1);
  }
/**
   * mimics the inbuilt JS method to remove last item from an array
   *
   * @memberof CustomArray
   */
mimics the inbuilt JS method to remove last item from an array
@memberof CustomArray
mimics the inbuilt JS method to remove last item from an array @memberof CustomArray
pop() {
    if (this.length === 0) {
      throw new Error("Invalid operation on an empty array.");
    }
    this.deleteItemAndUpdateLength(this.length - 1);
  }
pop ( ) { if ( this . length === 0 ) { throw new Error ( "Invalid operation on an empty array." ) ; } this . deleteItemAndUpdateLength ( this . length - 1 ) ; }
mimics the inbuilt JS method to remove last item from an array
 @memberof CustomArray
mimics the inbuilt JS method to remove last item from an array @memberof CustomArray