I'm working on a lecture about hard to understand JavaScript code and of course on of the weak point of JavaScript is knowing what == / === will return. I found this great answer in stack that covers this subject nicely - Which equals operator (== vs ===) should be used in JavaScript comparisons?
one of the things that caught my eyes (probably because I wasn't aware of it until now) was that you can use String Objects instead of primitives and you will get different result in your conditions -
"abc" == new String("abc") // true
"abc" === new String("abc") // false
I wanted to test it and found out a few not so intuitive results using String Objects -
new String("abc") === new String("abc") // false
and even
new String("abc") == new String("abc") // false
at the beginning I thought this is a browser bug, but I tested it both on chrome and Firefox. So I'd be really happy if some one could share more information how can it be that comparing a literal string and a string object will be truthy but comparing two "equal" string objects will be falsy