How to make this design:

var sub = { ops: 'opsfe-efe', sut: 'sut-efe'} var params = { {sub.ops, 'мое значение'}, {sub.sut, 'еще одно мое значение' } } 

and then also take all the parameters from params in a loop?

Is it possible for some simple, this construction does not work in javascript?

  • one
    what is expected to see in params? Two fields with the value of the object? - Anton Shchyrov
  • what final form should params take? - Grundy

1 answer 1

You can do something like this:

 var sub = { ops: 'opsfe-efe', sut: 'sut-efe'}; var params = [ {id: sub.ops, val: 'мое значение'}, {id: sub.sut, val: 'еще одно мое значение' } ]; 
  • Thanks, works - J Mas