This is my very first program in javascript! I've been trying to go through tutorials and I kind of get it. But my code doesn't work! I want to find out why??? An explanation of the error would help me understand.
document.write("Random # (1-5) = ", Math.floor((Math.random() * 5) + 1), "<br />");
if(Random = 2){
alert("Your names Bob");
}else {
alert("Your names Superman");
}
This program writes to the page a random number between 1 and 5, (works fine...) then, say, if the random number is 2, I want to alert the user that their name is Bob, and if the number isn't 2, alert them that their name is Superman...
Complete noob/beginner here, sorry if this frustrates you, but I appreciate your understanding! The only way to learn!!! Cheers :)