indexOf(data) {

        // special case: the list is empty so there's nothing to search
        if (this[head] === null) {
            return -1;
        }

        /*
         * The `current` variable is used to iterate over the list nodes.
         * It starts out pointing to the head and is overwritten inside
         * of the loop below.
         */
        let current = this[head];

        /*
         * The `index` variable is used to track how deep into the list we've
         * gone. This is important because this is the value that is returned
         * from this method.
         */
        let index = 0;

        /*
         * This loop checks each node in the list to see if it matches `data`.
         * If a match is found, it returns `index` immediately, exiting the
         * loop because there's no reason to keep searching. The search
         * continues until there are no more nodes to search because `current`
         * is once again pointing the first node in the list.
         */
        do {

            /*
             * If the data in the current node matches the data we are looking
             * for, then return `index`. This exits the loop immediately.
             */
            if (current.data === data) {
                return index;
            }

            // otherwise, go on to the next node
            current = current.next;

            // and increment the index
            index++;

        } while (current !== this[head]);

        /*
         * If execution gets to this point, it means we reached the end of the
         * list and didn't find `data`. Just return -1 as the "not found" value.
         */
        return -1;
    }
Retrieves the index of the data in the list.
@param {*} data The data to search for.
@returns {int} The index of the first instance of the data in the list
     or -1 if not found.