Hello.
Suppose we have an object with a very large number of parameters and functions.

var obj = { param1: Object, param2: Function, param3: 'Вообще, что угодно', ... param_n: 'И еще что-нить' } 

How can I add another parameter to this object?
PS :
With the use of the ExtJS library or without any libraries ( native JS ).

  • On a simple js there is no way, only ExtJS. - Oleg

2 answers 2

Option 1:

 obj['param125'] = '123'; 

Option 2:

 obj.param125 = '123'; 

    Better to use this ad here:

     var obj = new Object(); obj.param1 = Object; obj.param2 = 4; obj.param2 = true; 
    • one
      new Object() and {} equivalent. - Oleg