Yongxu Ren (2015-10-16T01:40:56.000Z)
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(>) ```