检查数组中是否有重复项

	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 @ 2024-03-21 16:51  橙云生  阅读(12)  评论(0)    收藏  举报