Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javascript console log not working

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.

like image 648
Jill Avatar asked Oct 20 '22 21:10

Jill


1 Answers

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.

like image 70
Quentin Avatar answered Nov 02 '22 07:11

Quentin