Static & Private Class Fields
What benefit does private implementation provide for this data structure?
class Tree {
#value;
#left;
#right;
constructor(value) {
this.#value = value;
}
insert(value) {
if (value < this.#value) {
if (this.#left) this.#left.insert(value);
else this.#left = new Tree(value);
} else {
if (this.#right) this.#right.insert(value);
else this.#right = new Tree(value);
}
}
}