JS数组返回去重后数据的方法解析
作者:风云01 时间:2024-05-02 17:40:10
话不多说,请看代码:
function removeRepeat(data) {
var temp = "";
var mainData = [];
for (var i = 0; i < data.length; i++) {
if (!data[i].parent) {
temp = data[i];
for (var j = 0; j < data.length; j++) {
if (temp.DeliveryType == data[j].DeliveryType) {
data[j].parent = true;
}
}
mainData .push(data[i])
}
}
return mainData ;
}
来源:http://www.cnblogs.com/Michael-D/p/6237938.html
标签:js,数组,返回,数据
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python图像处理之直线和曲线的拟合与绘制【curve_fit()应用】
2021-01-28 10:30:49
![](https://img.aspxhome.com/file/2023/3/67353_0s.png)
js和php如何获取当前url的内容
2023-11-14 10:09:12
python使用urllib2提交http post请求的方法
2023-11-24 19:35:53
使用tensorflow实现矩阵分解方式
2022-04-17 17:01:17
![](https://img.aspxhome.com/file/2023/7/89347_0s.jpg)
Mysql允许外网访问设置步骤
2024-01-26 18:31:17
![](https://img.aspxhome.com/file/2023/2/71712_0s.png)
PHP PDOStatement::getAttribute讲解
2023-06-05 07:29:31
基于Python绘制3D立体爱心图案的示例详解
2021-04-03 18:05:09
![](https://img.aspxhome.com/file/2023/3/68263_0s.png)
PHP开发中常见的安全问题详解和解决方法(如Sql注入、CSRF、Xss、CC等)
2023-10-02 23:03:06
Python+Tkinter实现简单的画图软件
2021-11-11 17:25:45
![](https://img.aspxhome.com/file/2023/4/70704_0s.gif)
MS Server和Oracle中对NULL处理的一些细节差异
2009-06-10 17:35:00
Pandas中GroupBy具体用法详解
2023-08-10 04:16:42
浅谈python opencv对图像颜色通道进行加减操作溢出
2021-12-26 11:45:23
![](https://img.aspxhome.com/file/2023/3/99473_0s.jpg)
如何用Python实现自动发送微博
2021-04-05 22:47:32
![](https://img.aspxhome.com/file/2023/9/128279_0s.jpg)
Python 实现局域网远程屏幕截图案例
2021-05-13 13:43:43
![](https://img.aspxhome.com/file/2023/8/66788_0s.jpg)
JS、CSS和HTML实现注册页面
2024-04-17 10:03:20
![](https://img.aspxhome.com/file/2023/7/136417_0s.jpg)
Perl eval函数使用实例
2022-12-21 05:25:55
tensorflow之自定义神经网络层实例
2022-05-26 07:05:27
用Python编程实现语音控制电脑
2022-01-06 22:53:57
基于Python制作打地鼠小游戏
2022-04-07 09:13:34
几行代码让 Python 函数执行快 30 倍
2021-06-22 14:52:23
![](https://img.aspxhome.com/file/2023/5/128645_0s.png)