As the object could be a primitive?

let b = new Boolean(true);
 console.log(typeof b) // object
 console.log(b) // true


How to understand this situation? Why the b object created through the constructor works as a primitive? Another mistake in the language?
April 7th 20 at 15:44
3 answers
April 7th 20 at 15:46
Solution
You write:
console.log(b) // true
But that isn't true, it displays not true, and the Boolean {true}
The browser on the smartphone brought true - russel commented on April 7th 20 at 15:49
April 7th 20 at 15:48
Because the prototype object)))
April 7th 20 at 15:50
Have already figured out. The misunderstanding was due to the fact that the brother on the smartphone(I think this is a webview) in the console output is not a Boolean object, and true - russel commented on April 7th 20 at 15:53

Find more questions by tags JavaScript