CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

Truthy and Falsy in if

JavaScript code walkthrough · Question 17
easyIf Statements

Code

Read carefully. What does this print?
1let count = 0;
2if (count) {
3 console.log("has count");
4} else {
5 console.log("no count");
6}
7let name = "Joe";
8if (name) {
9 console.log("has name");
10}

Your answer