equals(OtherLinkedList) {
        if (this.size() !== OtherLinkedList.size())
            return false;
        for (var i = 0; i < this.size(); i++) {
            if (!this.getNode(i).equals(OtherLinkedList.getNode(i)))
                return false;
        }
        return true;
    }
/**
     * checks if the current linked list is equal to the other linked list
     * @param {LinkedList} OtherLinkedList the other linked list that will be compared to the current linked list
     */
checks if the current linked list is equal to the other linked list
@param {LinkedList} OtherLinkedList the other linked list that will be compared to the current linked list
checks if the current linked list is equal to the other linked list @param { LinkedList } OtherLinkedList the other linked list that will be compared to the current linked list
equals(OtherLinkedList) {
        if (this.size() !== OtherLinkedList.size())
            return false;
        for (var i = 0; i < this.size(); i++) {
            if (!this.getNode(i).equals(OtherLinkedList.getNode(i)))
                return false;
        }
        return true;
    }
equals ( OtherLinkedList ) { if ( this . size ( ) !== OtherLinkedList . size ( ) ) return false ; for ( var i = 0 ; i < this . size ( ) ; i ++ ) { if ( ! this . getNode ( i ) . equals ( OtherLinkedList . getNode ( i ) ) ) return false ; } return true ; }
checks if the current linked list is equal to the other linked list
 @param {LinkedList} OtherLinkedList the other linked list that will be compared to the current linked list
checks if the current linked list is equal to the other linked list @param { LinkedList } OtherLinkedList the other linked list that will be compared to the current linked list