Implement Point
so that:
new Point( new Point(10, 20) + new Point(30, 50) ).toString() === '{40,70}'
Must be generic and be able to handle x
and y
values from 0..999 (integers only)
Minor hint: you'll need to implement valueOf
and toString
methods.
Yaay :) Thanks for the exercise.
It would've been great if we could override operators in JS. Oh, well :)