return the smallest positive integer that is not present in the array javascript code example
Example: finding the smallest number in an array javascript
var arr = [5,1,9,5,7];
var smallest = arr[0];
for(var i=1; i<arr.length; i++){
if(arr[i] < smallest){
smallest = arr[i];
}
}
console.log(smallest);