Can I set a private class field using a variable as identifier? How?
No, this doesn’t look to be possible. From the proposal FAQ: Why doesn’t this[‘#x’] access the private field named #x, given that this.#x does? This would complicate property access semantics. Dynamic access to private fields is contrary to the notion of ‘private’. E.g. this is concerning: class Dict extends null { #data = something_secret; add(key, … Read more