how to find missing element in an array in javascript code example
Example: 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)