Point Series 1: Skeleton

Published by Krishna Bhadkoliya in

Write a class called Point that represents a point in two-dimensional. It should have the following constructor:

constructor(x, y)

It should have the following properties:

x

y

It should have the following methods:

toString()
  • Returns a string representation of this point, as [x=1, y=2].
Watch a quick demo on how Edabit works.