How can we create Boolean-like object in JavaScript?
<p>I want to create my Boolean-like object.
But I don't want to pollute Boolean.prototype.
So I created MyBool like</p>

<pre><code>MyBool = function (x) {
  this.value = x;
  this.valueOf = function () { return x; };
  this.toString = function () { return x; };
}
MyBool.prototype.and = function (y) {
  if (y.constructor !== MyBool) throw 'You cannot do that!';
  return this.value &amp;&amp; y.value;
}
</code></pre>

<p>and its instances</p>

<pre><code>mytrue = new MyBool(true);
myfalse = new MyBool(false);
</code></pre>

<p>But now, I noticed that</p>

<pre><code>if (myfalse) {
  console.log ("myfalse is true!!!")
}
</code></pre>

<p>prints that myfalse is true!!!</p>

<p>(Yet +myfalse (that is [[ToNumber]] conversion) comes to falsy, thanks to valueOf)</p>

<p>It's obvious because only following values are falsy in ECMAScript.</p>

<pre><code>undefined, null, false, +0, -0, NaN, ''
</code></pre>

<p>If Argument Type is Object, [[ToBoolean]] brings us true, in any case.
(see ECMA Type Conversion and Testing)</p>

<p>Is there any crafty way to create a falsy object?
It's ok if</p>

<pre><code>myfalse.constructor is MyBool
(!! myfalse) is false
</code></pre>

<p>Any cheat is welcome, including ECMA5's set/get/defineProperty or anything else.</p>

<p>Thanks in advance.</p>
