Js如何拼装一个新的JSON格式的对象

var SchemaIpList = [];

SchemaIpList.push({envId:envListData.object[index].id, envName:envListData.object[index].name});

(SchemaIpList[index_j]).ips = envIpList[index_i].ips;
(SchemaIpList[index_j]).count = (envIpList[index_i].ips).length;

 

[
    {
        envId: 5390,
        envName: '日常环境(中心)',
        ips:[
            "10.101.83.128",
            "11.239.174.115"
        ],
        count: 2,
    },
    {
        envId: 31503,
        envName: '日常环境2',
        ips:[
            "100.69.199.151",
            "10.101.83.128"
        ],
        count: 2,
    },
]

 

posted @ 2016-10-11 17:07  RoperLee  阅读(2648)  评论(0)    收藏  举报