Loading

向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;
posted @ 2017-09-03 00:59  Dhoopu  阅读(1027)  评论(0编辑  收藏  举报