Menu
Hello,
I am trying to learn JavaScript and I have set up the code below. In my Alert dialog when I run it, I get the value 600. I am trying to get it to say the sentence..
“high score belongs to (either playerOne or playerTwo)….instead the alert says 600.
can someone tell me what I am doing wrong??
thanks
babs
var playerOne=500;
var playerTwo=600;
var highScore;
if (playerOne>playerTwo){
highScore=playerOne;
}
else {
highScore=playerTwo;
}
alert (“high score belongs to ” && highScore);
thanks!