Hey Bob, FWIW...

> class Point {
>   constructor(x, y) {
>     this.x = x;
>     this.y = y;
>   }
>
>   zero() {
>     return new Point(0, 0);
>   }
>
>   unit() {
>     return new Point(1, 1);
>   }
>
>   prototype {
>     manhattanDistance() {
>       return Math.abs(this.x) + Math.abs(this.y);
>     }
>   }
> }
>

...That's actually the nicest, most intuitively designed "class" structure
I've seen so far.

Rick
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to