Boolean : Object
A true or false value.
Primitive:
true
Spec:
http://www.ecma-international.org/ecma-262/5.1/#sec-15.6
----
Boolean(value : Object) : Boolean
Coerces **value** into a boolean value. You can also use **!!value** to
do the coercion.
console.log(Boolean(''));
console.log(Boolean('0'));
console.log(Boolean(0));
console.log(Boolean(1));
console.log(Boolean([]));
console.log(Boolean(undefined));
console.log(!!undefined);
Spec:
http://www.ecma-international.org/ecma-262/5.1/#sec-15.6.1
----
new Boolean(value : Object) : Object
Creates a box for a boolean value.
var literal = true;
var boxed = new Boolean(true);
console.log(literal === true);
console.log(boxed === true);
console.log(boxed.valueOf() === true);
console.log();
// Literals cannot hold other properties but boxes can
literal.foo = 'bar';
boxed.foo = 'bar';
console.log(literal.foo);
console.log(boxed.foo);
Spec:
http://www.ecma-international.org/ecma-262/5.1/#sec-15.6.2
----
prototype.toString() : String
Returns a string representation of **this**.
console.log(true.toString());
console.log(false.toString());
Spec:
http://www.ecma-international.org/ecma-262/5.1/#sec-15.6.4.2