ColorPoint(x, y, color)

The ColorPoint class, extends Point.

parameter type description
x
y
color

Examples

let cp = new ColorPoint(25, 8, 'green');
console.log(cp instanceof ColorPoint); // true
console.log(cp instanceof Point); // true

toString

Class method, overwrites toString of Point.

Examples

let cp = new ColorPoint(25, 8, 'green');
       cp.toString(); // '(25, 8) in green'

Point(x, y)

A Point class, declared using the declaration-form.

parameter type description
x
y

Examples

let p = new ColorPoint(25, 8, 'green');
console.log(p instanceof Point); // true

toString

A class method.

Examples

let p = new ColorPoint(25, 8);
       p.toString(); // '(25, 8)'