forEach(callbackfn) {
        let node = this.head;
        while (node != null) {
            callbackfn(node.val);
            node = node.next;
        }
    }
// forEach runs a function for each node in the list
forEach runs a function for each node in the list
forEach runs a function for each node in the list
forEach(callbackfn) {
        let node = this.head;
        while (node != null) {
            callbackfn(node.val);
            node = node.next;
        }
    }
forEach ( callbackfn ) { let node = this . head ; while ( node != null ) { callbackfn ( node . val ) ; node = node . next ; } }
forEach runs a function for each node in the list
forEach runs a function for each node in the list