js json数组去重

去除数组中code相同的数据

var $a ={                                                      
    "total":3,                                                      
    "rows":[                                                          
        {"id":"1","code":"20-2340","qymc":"变速驱动桥总成-M/T"},         
        {"id":"2","code":"25-3245A","qymc":"螺栓","pfkmc"},         
        {"id":"3","code":"20-2340","qymc":"变速驱动桥总成-M/T"}
    ]                                                          
}

$b = {"total":0,"rows":[]};
var tem = $a.rows;
var len = tem.length;
var i=0;
var arr = [];
for(; i

你可能感兴趣的:(js)