Say i have an following class in javascript
class A {
constructor(createB){
if(createB === undefined) this.b = new B();
}
}
class B extends A {
constructor(){
super(false);
}
}
var global = {};
global.a = new A();
delete global.a;
now what will happen to the instance of B
?
will that instance of B
and its memory automatically destroyed?