Closed BK239 closed 6 years ago
Use the new syntax for class definitions and constructors (keywords class and constructor). For instance, the code below
var Shape = function (id, x, y) { this.id = id; this.move(x, y); }; Shape.prototype.move = function (x, y) { this.x = x; this.y = y; };
should be replaced by the following:
class Shape { constructor (id, x, y) { this.id = id this.move(x, y) } move (x, y) { this.x = x this.y = y } }
This syntax is clearer, making it easier to understand and search for.
No longer needed since assignment 3 is done!
Use the new syntax for class definitions and constructors (keywords class and constructor). For instance, the code below
should be replaced by the following:
This syntax is clearer, making it easier to understand and search for.