检查数组中是否有重复项

	function checkRepeatOrSameType(arr) {
				    return arr.some(function(v, index) { 
						const idx = arr.findLastIndex(s => (v.id == s.id || (v.type && v.type == s.type)))
				        return idx !== index; 
				    });
			}
posted @   橙云生  阅读(6)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示