JS对象添加新的字段

var test={name:"name",age:"12"};

test.id = "12345";

直接定义添加就成了

原文地址:https://www.cnblogs.com/danlis/p/5479147.html