📌  相关文章
📜  确定数组是否有重复 lodash - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:59.330000             🧑  作者: Mango

代码示例1
function hasDuplicates(a) {
  return _.uniq(a).length !== a.length; 
}

var a = [1,2,1,3,4,5];
var b = [1,2,3,4,5,6];

document.write(hasDuplicates(a), ',',hasDuplicates(b));