Javascript Functions using unicode operator signs as names?
<p>I was looking at this: <a href="http://stackoverflow.com/questions/1661197/valid-characters-for-javascript-variable-names">Valid Characters for JavaScript Variable Names</a></p>

<p>And I had a thought, and I can't decide if it is a good idea or not...</p>

<p>Say you have some object, for example a <strong>Vector</strong> (x, y, z):</p>

<pre><code>Vector = (function() {
  function Vector(x, y, z) {
    this.x = x != null ? x : 0;
    this.y = y != null ? y : 0;
    this.z = z != null ? z : 0;
    if (isNaN(this.x) || isNaN(this.y) || isNaN(this.z)) {
      throw new Error("Vector contains a NaN");
    }
  }

  return Vector;
})();
</code></pre>

<p>and you wanted to add some *<em>Vector</em>*s, possibly with a function like this:</p>

<pre><code>this.add = function(v) {
  return new Vector(this.x + v.x, this.y + v.y, this.z + v.z);
};
</code></pre>

<p>Would it be awful, or awesome, to declare the addition function as <code>this["\u002b"] = function...</code> (or even just <code>this["+"] = function...</code>), and use it like:</p>

<pre><code>var v1 = new Vector(1, 2, 3)
var v2 = new Vector(2, 3, 4) 
var v3 = v1["+"](v2)
</code></pre>

<p>Obviously, for <em>"add"</em>, theres no actual gain in terms of the code size (I think it might be slighly more readable than v1.add(v2), but something such as <em>"multiply"</em> would be,</p>

<pre><code>var v1 = new Vector(1, 2, 3);
v1["×"](2);
</code></pre>

<p>or for other objects something like <em>"integrate"</em> could be:</p>

<pre><code>integrand["∫"](0, 1000)
</code></pre>

<p>Thoughts? Is it wonderfully wonderful, or horribly hacky? How reliable are unicode characters across browsers? Would it be safe to use in node.js?</p>
