Kevin Barabash (2016-05-12T05:16:59.000Z)
kevinb at khanacademy.org (2016-05-12T05:19:08.262Z)
@Isiah: Great points. One potential edge case though: ```js class A { operator+ (other) { } } class B { operator+ (other) { } } const a = new A(); const b = new B(); const c = a + b; ``` In the case where both the left and right side have `[[OpPlus]]` do we prefer the left side? > But, do we really need operator overloading? A method can be used > instead, I think. @Dawid: Suppose I create a class to represent complex numbers that looks like this: ```js class Complex { constructor(re, im) { Object.assign({ }, { re, im }); } add(other) { return new Complex(this.re + other.re, this.im + other.im); } ... } ``` I might want to create instance of `Complex` with plain old numbers or I might want to use `BigNumber` instances. Without operator overloading this means that I would have add methods to `Number.prototype` or wrap each number in an object with methods. Neither of which are particular appealing. On Wed, May 11, 2016 at 1:28 AM, Isiah Meadows <isiahmeadows at gmail.com> wrote: