My code is as follows,
class myClass
{
constructor()
{
this.memberVar1="";
this.memberVar2="";
}
memberFunction1()
{
// memberFunction1 code
}
}
var myObj = {
objVar1 : someJsonObject,
objVar2 : new myClass()
}
Instead of calling the memberFunction and memberVar1,memberVar2 like
myObj.objVar2.memberVar1;
myObj.objVar2.memberFunction1();
I wish to call them as follows
myObj.memberVar1;
myObj.memberFunction1();
Is there any way i can restructure myObj to achieve this ?
Thanks in advance