Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Find the stray number

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]))
 
PREVIOUS NEXT
Tagged: #Find #stray #number
ADD COMMENT
Topic
Name
9+7 =