Lets say you have a class like this:
class ExampleClass {
#foo;
constructor(){
let VarName = 'foo';
let VarNamePrefixed = '#foo';
this[#VarName] = 'Bar'; // won't work, syntax error.
this[VarNamePrefixed] = 'Bar'; // Won't work, escapes into a string.
}
}
Is there a nice way to set private (#foo) variables using the array notation?