S
Steve Swift
On page 90 of my O'Reilly "Javascript The definitive guide" 3rd edition
there is an example of an If/Else construct: (some text removed)
If (username != null)
alert("Hello " + username);
else {
username = prompt("What is your name?");
alert("Hello " + username);
}
Should I erase the first ";" from the second line?
It certainly works better in my tests that way, but I don't know if this
is an error in the book, a change in the way JavaScript works, or a flaw
in my browser.
there is an example of an If/Else construct: (some text removed)
If (username != null)
alert("Hello " + username);
else {
username = prompt("What is your name?");
alert("Hello " + username);
}
Should I erase the first ";" from the second line?
It certainly works better in my tests that way, but I don't know if this
is an error in the book, a change in the way JavaScript works, or a flaw
in my browser.