I've tried searching for but perhaps I am describing it incorrectly since I'm not having any luck finding results.
I want to do this:
XS.prototype.Abc=function $Def(a,c){ ... }
But I would like XS
, ABC
, and $Def
to be variables ( dynamic)
For XS
since this is in the global scope I think that I can use window[]
like this:
var myindex = 'XS';
window[myindex].prototype.Abc=function $Def(a,c){ ... }
I read over What is the difference between call and apply? but I still can't figure out if it would be possible to use call
or apply
to do the other two as variables.