Why is string = '0' not strictly equal to new String('0') in javascript

Viewed 293

Why does the creation of a string object not return true when compared strictly to a primitive string value?

var obj = new String('0');
var str = '0';

console.log(obj == str); //returns true
console.log(obj === str); //returns false
3 Answers
Related