1let a = [5, 7],
2 count = 10,
3 missing = []
4
5for (let i = 1; i <= count; i++) {
6 if (a.indexOf(i) === -1) {
7 missing.push(i)
8 }
9}
10console.log(missing)
1var a = [5],
2 count = 5;
3var missing = new Array();
4
5for (var i = 1; i <= count; i++) {
6 if (a.indexOf(i) == -1) {
7 missing.push(i);
8 }
9}
10console.log(missing); // to check the result.