J
Jim Davidson
I'm teaching myself javascript and need some help with this code. can
someone tell me what's wrong with it?
function getRandomNo()
{
while (true)
{
nImgNo = Math.round(Math.random() * 10);
var strImgNo = ""+nImgNo;
if (string_of_ImgNo.indexOf(strImgNo) = -1)
{
string_of_ImgNo = string_of_ImgNo+strImgNo;
break;
}
if (string_of_ImgNo.length > 9) break;
return nImgNo
}
}
someone tell me what's wrong with it?
function getRandomNo()
{
while (true)
{
nImgNo = Math.round(Math.random() * 10);
var strImgNo = ""+nImgNo;
if (string_of_ImgNo.indexOf(strImgNo) = -1)
{
string_of_ImgNo = string_of_ImgNo+strImgNo;
break;
}
if (string_of_ImgNo.length > 9) break;
return nImgNo
}
}