您的位置:首页 > 移动开发 > Objective-C

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

2017-09-03 00:59 495 查看

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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐