向json中添加新的熟悉或对象 Add new attribute (element) to JSON object using JavaScript

How do I add new attribute (element) to JSON object using JavaScript?

JSON stands for JavaScript Object Notation. A JSON object is really a string that has yet to be turned into the object it represents.
To add a property to an existing object in JS you could do the following.

方法1

object["property"] = value;

方法2

object.property = value;
原文地址:https://www.cnblogs.com/dupeng0811/p/add-new-attribute-element-to-json-object-using-javascript.html