1

Please look into the example code below

var temp = {
    load:function(x) {
        //using x need to initialized an object or call a function
        //example object name xConf.We need to do concatenate also
        var obj=x+'Conf';
        new obj();          // not working
        global.obj.add()    // not working
    }
};

Looking forward for your suggestions.

Jonathan.Brink
  • 23,757
  • 20
  • 73
  • 115
manashb
  • 179
  • 1
  • 1
  • 12

1 Answers1

1

The following should work:

global[x + 'Conf'].addConfig();

Not that this assumes that the object is available in the global namespace.

OptimusCrime
  • 14,662
  • 13
  • 58
  • 96