I have a list of /24 IP addresses in an array called subRet
subRet's values are like 10.0.0.1 10.0.0.2 10.0.0.50 10.0.0.80
What I want is a list of IP address that are NOT in the array.
What I've tried is this:
var test=['10.0.0.1','10.0.0.103','10.0.0.111','10.0.0.131','10.0.0.198'];
for(i=1;i<=254;i++){
if( ! $.inArray('10.0.0.'+i.toString(), test ) ) {
console.log("adding "+'10.0.0.'+i.toString());
}
}
Console log says
adding 10.0.0.1
What I want is a list if IP's that are not in the list, like 10.0.0.2.
how?