I am reading through the Mozilla Manual on JavaScript, and I come to this point in my reading, Boolean object. I can\'t see a single use for them. What\'s their point? Why w
From the documentation:
Do not confuse the primitive Boolean values true and false with the true and false values of the Boolean object. Any object whose value is not undefined , null, 0, NaN, or the empty string , including a Boolean object whose value is false, evaluates to true when passed to a conditional statement.
Imagine the following scenario:
if(SomeBoolean){...}
will be true in scenarios where SomeBoolean is a Boolean object.
Conversely:
if(false){...}
will always be false
Addendum for clarification.
var someString = new Boolean("MyNonEmptyString")
if(someString) //true
var otherString = new Boolean("")
if(otherString) //false