I am new to JS. Today I was trying to practice a little of what I've learned, and I can't get my console log to print anything. My "good morning" alert works, as well as my initial prompt question, but once I answer "yes" or "no," everything stops. Here is my code:
alert("Good morning!");
var hireMe = prompt("Are you here because you're interested in hiring me?");
if (hireMe === "yes") {
console.log("You've just made my day. Carry on.")
}
else {
console.log("Well, I hope you're at least thinking about it.")
}
Thanks.
I don't see any console window appear at all. It's as if no more code is written beyond the prompt
console.log
will write to the console.
It will not cause the console window to open if it isn't already open.
You have to open your browser's console (the Developer Tools since you are using Chrome) manually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With