Lesson 28. Conclusion: Part 2


#1

var myName = "Duane";
if (myName.length = 8){
console.log("I finished my first course!");
}else{
console.log("You are wrong!");
}

The above is printing as correct?

What am I doing wrong?


#2

Well You spoted another

:bug: Ima Talk this out with a mod again.


#3

Cheers mate,

I initially had

var myName = "Duane";
if (myName.length = 5){
console.log("I finished my first course!");
}else{
console.log("You are wrong!");
}

It was printing out as correct, and then I changed the 5 to an 8 to see if it would print out the else statement, but it didn't


#4

Ha we will sort it out soon!


#5

You've just used the wrong operator there.

= is used for setting a value
== and === are used for comparing values

You want to compare values.


#6

Oh, did not see that. Wow your really good at tracking mistakes.


#7

Thank you!

Need to remember that in the future!

I will retry the code now.

Cheers