Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

find the missing value in an integer array javascript

let a = [5, 7],
  count = 10,
  missing = []

for (let i = 1; i <= count; i++) {
  if (a.indexOf(i) === -1) {
    missing.push(i)
  }
}
console.log(missing)
Source by elielrom.com #
 
PREVIOUS NEXT
Tagged: #find #missing #integer #array #javascript
ADD COMMENT
Topic
Name
7+7 =