I have this simple code -
class Repo {
constructor(someParam = null) {
this.getDic = someParam;
}
static set getDic(ref){
this.ref = ref;
}
static get getDic(){
return this.ref;
}
static key(key){
return this.getDic[key];
}
}
let newRepo = new Repo({yeah: 'baby'});
Repo.key('yeah') // Uncaught TypeError: Cannot read property 'yeah' of undefined
Why is the 'getDic' getter undefined in the 'key' static method?
Thanks!