Witam !
Mam taki kod :
var modules = {}
function apply_to_B(instance) {
modules['B'] = instance.apply(instance,function() {
function a() {
console.log('aaaaaaaaaaaaaaaa');
}
return {
a:a
}
});
}
apply_to_B(function(mod) {
console.log(mod);
function b() {
mod.a();
}
return {
b:b
}
});
let ret = modules['B'];
ret.b();
Wyskakuje TypeError: Cannot read property 'a' of undefined
. Co robię źle ?