Is it possible to extend an object "into" a function?
<p>I've always found it interesting that in JavaScript you can actually extend functions into objects:</p>

<pre><code>var order = function(x, y) {
  return x &lt; y ? [x, y] : [y, x];
};

order.backwards = function(x, y) {
  return order(x, y).reverse();
};
</code></pre>

<p>I won't claim there is much reason to do the above (but then again, why not?); my question is simply whether it's possible to do the opposite. That is, could I have something like:</p>

<pre><code>var order = {
    backwards: function(x, y) {
        return order(x, y).reverse();
    }
};

// Obviously, this is not real; I'm just wondering if there's any way
// to accomplish the same thing.
addFunctionBehavior(order, function(x, y) {
    return x &lt; y ? [x, y] : [y, x];
};
</code></pre>
