Example 1 works as intended.
Example 2 does not, and there is no error message. An empty window opens and nothing happens.
I'm running them on the same OS and browser(Ubuntu, Firefox)
Since I assume I typed something wrong I already compared it to the source but I can't find my mistake.
var yourName = prompt("Please enter your name\nenter:","name"); alert("You entered:\n" + yourName + "\nThank you!"); document.write(yourName);
var number = prompt("Enter first number:","0"); var n1 = parseFloat(number); var n2 = parseFloat(prompt("Enter a second number","0"); var sum = n1 + n2; alert (n1 + " + " + n2 + " = " + sum);