ColorPoint(x, y, color)
The ColorPoint class, extends Point.
| parameter | type | description |
|---|---|---|
| x | ||
| y | ||
| color |
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.
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 |
let p = new ColorPoint(25, 8, 'green');
console.log(p instanceof Point); // true
toString
A class method.
let p = new ColorPoint(25, 8);
p.toString(); // '(25, 8)'