True and False Values II

what is wrong with is code can not find the error and it wont tell me where i messed up
let wordCount = 5;

if (wordCount) {
console.log(“Great! You’ve started your work!”);
} else {
console.log(‘Better get to work!’);
}

let favoritePhrase = ‘’;

if (!favoritePhrase) {
console.log (‘This string is defintely empty’);
} else {
console.log(“This string doesn’t seem to be empty!”);
}

What do you expect to happen?
It’s hard to troubleshoot something if you don’t know what output you wanted and what output you got.

1 Like

@essembe03 I agree with @fight_dragons It’s also easier to understand your code with proper formatted text

for example.

let wordCount = 5;

if (wordCount) {
console.log(“Great! You’ve started your work!”);
} else {
console.log(‘Better get to work!’);
}

let favoritePhrase = ‘’;

if (!favoritePhrase) {
console.log (‘This string is defintely empty’);
} else {
console.log(“This string doesn’t seem to be empty!”);
}

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.