I\'m trying to find an easy way to loop (iterate) over an array to find all the missing numbers in a sequence, the array will look a bit like the one below.
var nu
function missingNum(nums){ const numberArray = nums.sort((num1, num2)=>{ return num1 - num2; }); for (let i=0; i < numberArray.length; i++){ if(i !== numberArray[i]){ return i; } } } console.log(missingNum([0,3,5,8,4,6,1,9,7]))