Hello! On js from JSON, I restored an object of the following form:
{"1":{"108":{"3":"605500","6":"785000"},"113":{"6":"60000"}}}
Tell me, please, how can I add new values to it?
Hello! On js from JSON, I restored an object of the following form:
{"1":{"108":{"3":"605500","6":"785000"},"113":{"6":"60000"}}}
Tell me, please, how can I add new values to it?
Well, first, give it a name:
var sampleObj = {"1":{"108":"605500","6":"785000"},"113":{"6":"60000"}};
And then - as you like:
sampleObj['2'] = 3; sampleObj.s = 15;
js_conveniently_model_prices['1']['112']['3']=5;
- Zhukov Romanjs_conveniently_model_prices['1']['112']
- Zhukov RomanTranslate to json object, add values, translate to string.
You can still be perverted with parsing, but it is likely to spoil everything.
Source: https://ru.stackoverflow.com/questions/199293/
All Articles
"108":"3":"605500"
- incorrect JSON, if that. - Zhukov Roman