Random numbers from 1-50 are drawn and displayed in a alert dialog box.

var i, rand, temp, str;
var nums = new Array(50)
for (i = 1; i < 51; i++) nums[i] = i;
for (i = 1; i < 51; i++)
{
rand = Math.ceil(Math.random() * 50);
temp = nums[i];
nums[i] = nums[rand];
nums[rand] = temp;
}
str = "Your six lucky numbers are:\n\n";
for (i = 1; i < 7; i++)
{
str +=nums[i];
if (i != 6)
{
str += " - "
}
}
alert (str);