function getRandomIP(){
var ip = [];
for(var i=0; i<4; i++){
//判断是否小于3,决定后面要不要拼接.
if(i<3){
ip = ip+Math.floor(Math.random()*256)+"."
}else{
ip = ip+Math.floor(Math.random()*256)
}
//ip = i<3 ? ip+Math.floor(Math.random()*256)+"." : ip+Math.floor(Math.random()*256)
}
return ip
}
js生成随机IP
于 2022-11-03 16:26:15 首次发布