Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Foundations Numbers The Math Object

Quiz says 10 == "10" is false. When I run that in the console, it's true.

The lesson taught us that 10 == "10" should evaluate to True and that 10 === "10" should evaluate to false, due to the differing value types.

Running this in the console confirms this.

I got the question wrong in the quiz when it asked does 10 == "10"? and I answered, "True".

Not a big deal, but that quiz question contradicts the lesson.

I can tag the staff on this but can you see if you get that question again? A screenshot might help.

Raymond LeDuc
Raymond LeDuc
2,499 Points

I believe it was 10 === "ten"

3 Answers

Hi Lukas,

I tried going through the quiz several times to see if that question came up but all the questions were the same, just in a different order.

The closest I found was: 10 == "ten"

That would be false.

Thanks Jason,

You are right, I mis-typed and it should have been 10 == "ten" and that evaluates correctly.

I, erroneously, thought the == comparison operator would convert the "ten" string to the same data type as the 10 and provide a true response and that '===' is used to compare both value and data type. I don't know where I got that idea from!

Cheers,

Lukas

This wasn't a question so much as a "I think I found an issue with the quiz question". If I am wrong, please correct me!