public
Last active

  • Download Gist
gistfile1.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
function Parent(first, last) {
this.first = first;
this.last = last;
this.coordinates = [0, 0];
}
 
Parent implements {
speak: function (message) {
return this.first + ' ' + this.last + ': ' + message;
},
walk: function (horizontal, vertical) {
var coordinates = this.coordinates;
coordinates[0] += horizontal;
coordinates[1] += vertical;
return coordinates;
}
};
 
function Child(first, last) extends Parent {
super(first, last);
}
 
Child implements {
speak: function (message) {
return super(message).toUpperCase();
}
};

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.