Yongxu Ren (2015-10-16T01:40:56.000Z)
I vote for operator overloading!

I think this is probably going to be a good way to do it:
```
//in local scope
let operator(**) = (lhs,rhs) => Math.pow(lhs,rhs);

//class method
Complex.prototype.operator(+) = function(lhs,rhs){
  return new Complex(lhs.r+rhs.r,lhs.i+rhs.i);
}

//global, may not be an good idea
operator(+) = (lhs,rhs) => lhs*rhs;
```
//this will work for case above
names.sort(>)
```
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20151015/abeafa08/attachment.html>
renyongxu at gmail.com (2015-10-16T01:44:02.426Z)
I vote for operator overloading!

I think this is probably going to be a good way to do it :
```
//in local scope
let operator(**) = (lhs,rhs) => Math.pow(lhs,rhs);

//class method
Complex.prototype.operator(+) = function(lhs,rhs){
  return new Complex(lhs.r+rhs.r,lhs.i+rhs.i);
}

//global, may not be an good idea
operator(+) = (lhs,rhs) => lhs*rhs;
```
//this will work for case above
```
names.sort(>)
```