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
  • 21,521
  • 16
  • 66
  • 107
manashb
  • 169
  • 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,324
  • 12
  • 54
  • 94