//實(shí)現(xiàn)一個(gè)隨機(jī)IP 從0.0.0.0到252.255.255.255
//用.random()來實(shí)現(xiàn)
function randomSTR(){
var 字典 = '0123456789' //設(shè)置字典
var b = [] //新建一個(gè)空數(shù)組
for (var i=0; i<4; i++){ //IP地址有4個(gè)小節(jié)
var c = Math.floor(Math.random()*256) //生成0到255的隨機(jī)數(shù)
var b = b.concat(c) //拼接IP地址
}
return b.join('.') //將數(shù)組轉(zhuǎn)換為字符串
}
var a = randomSTR()
console.log(a)