I've been attempting to search for something, but it seems my descriptions are not yielding any results.
Here is what I am trying to achieve:
XS.prototype.Abc=function $Def(a,c){ ... }
However, I would like XS
, ABC
, and $Def
to be dynamic variables.
For XS
, as it is in the global scope, I believe I can use window[]
like so:
var myindex = 'XS';
window[myindex].prototype.Abc=function $Def(a,c){ ... }
I have reviewed What is the difference between call and apply?, but I am still unsure if I can use call
or apply
for the other two variables dynamically.