📅  最后修改于: 2022-03-11 15:04:11.328000             🧑  作者: Mango
function findUniq(arr) {
return arr.find(n => arr.indexOf(n) === arr.lastIndexOf(n));
}
console.log(findUniq([ 0, 1, 0 ]))
console.log(findUniq([ 1, 1, 1, 2, 1, 1 ]))
console.log(findUniq([ 3, 10, 3, 3, 3 ]))
console.log(findUniq([ 7, 7, 7, 20, 7, 7, 7 ]))