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

Very simple and short question.

<script>
alert(typeof Boolean('true'))
//Why "Boolean"  first letter is caps? Should not be lowercase because most of the method  I  have know start with lowercase like typeoff().
console.log(!10 < 10)
</script>

Why python return false, but JS return true
print(not 10 < 11)

1 Answer

console.log(!10 < 10)
// Since 10 is equal to 10, 10 is not less than 10. Thus, !10 < 10, i.e. 10 is not less than 10, is true.
print(not 10 < 11)
# 10 is clearly less than 11. Hence, not 10 < 11, i.e. 10 is not less than 11, is false.