You need to create this json

"pokaznik_10_2017" : { "1" : { "pokaznikVal" : "" }, "2" : { "pokaznikVal" : "" } .... , "368" : { "pokaznikVal" : "" } } 

Closed due to the fact that the essence of the question is not clear to the participants of Darth , Grundy , Yuri , Cheg , AK Jul 23 '17 at 9:43 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • it is impossible to create such JSON, because .... in the middle is a syntax error - Grundy
  • And what's the problem then? - Yuri
  • @Grundy I think .... this is something like "etc." - Klimenkomud
  • you need to create from 1 to 368. so as not to copy manually - olezha

1 answer 1

 for(let i = 1; i < 369; i++){ myObject[i] = { pokaznikVal: myValue } } 
  • try to run your first example - Grundy
  • The first example is not working, the second one works. My mistake - Egor Kulik
  • excellent, thanks) and how can I get it to copy? - olezha
  • The first example is not working - then you should not leave it in response, since it is still non-working - Grundy
  • 2
    @olezha, JSON.stringify - Grundy