Asked by Shogun
What is the output of this program?
let weather = "sunny";
if (weather == "rain") {
document.write("Wear a raincoat.");
}
else {
document.write("No raincoat needed today!");
}
(1 point)
Responses
an error message because the closing brace for the if statement is on the same line as the word else
an error message because the closing brace for the if statement is on the same line as the word else
an error message because document.write() instead of console.log() is used
an error message because document.write() instead of console.log() is used
“Wear a raincoat.”
“Wear a raincoat.”
“No raincoat needed today!”
let weather = "sunny";
if (weather == "rain") {
document.write("Wear a raincoat.");
}
else {
document.write("No raincoat needed today!");
}
(1 point)
Responses
an error message because the closing brace for the if statement is on the same line as the word else
an error message because the closing brace for the if statement is on the same line as the word else
an error message because document.write() instead of console.log() is used
an error message because document.write() instead of console.log() is used
“Wear a raincoat.”
“Wear a raincoat.”
“No raincoat needed today!”
Answers
Answered by
GPT 3.5
“No raincoat needed today!”