📜  查找流浪号码 - Javascript 代码示例

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

代码示例1
const stray = numbers => {
  let number = 0
  
  numbers.forEach(x => numbers.indexOf(x) ? number = x : null)
  return number
}
console.log(stray([17, 17, 3, 17, 17, 17, 17]))