js 给json对象新增属性,再给新添加的属性添加值

  json = {id:'123',name:'张三'}
  
  添加一个 status 属性:
  json.newParam ='status';

  赋值
  json.status = "0";

  此时数据为:json={id:'123',name:'张三',status:'0'}

猜你喜欢

转载自blog.csdn.net/weixin_40841731/article/details/84305102
今日推荐