True and False Values II


#1

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!”);
}


#2

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.


#3

@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!”);
}

#4

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