get size() {

        // special case: the tree is empty
        if (this[root] === null) {
            return 0;
        }

        /*
         * The `count` variable is used to keep track of how many items have
         * been visited inside the loop below. This is important because this
         * is the value to return from this method.
         */
        let count = 0;

        /*
         * Traversal is easiest when using a recursive function, so define
         * a helper function here. This function does an in-order traversal
         * of the tree, meaning it yields values in sorted order from 
         * lowest value to highest. It does this by traversing to the leftmost
         * node first, then working its way back up the tree, visiting right nodes
         * along the way.
         */
        const traverse = (node) => {

            // special case: there is no node
            if (node) {

                //traverse the left subtree
                if (node.left !== null) {
                    traverse(node.left);
                }

                // increment the counter
                count++;

                //traverse the right subtree
                if (node.right !== null) {
                    traverse(node.right);
                }
            }
        };

        // start traversing from the root
        traverse(this[root]);

        // return the final count, which was updated inside traverse()
        return count;

    }
Returns the number of items in the tree.
@returns {int} The number of items in the tree.