Skip to content

Instantly share code, notes, and snippets.

@codeperfectplus
Created September 11, 2023 08:31
Show Gist options
  • Select an option

  • Save codeperfectplus/4de696ad3d8e2f1a23940a6165d466aa to your computer and use it in GitHub Desktop.

Select an option

Save codeperfectplus/4de696ad3d8e2f1a23940a6165d466aa to your computer and use it in GitHub Desktop.
class Rectangle {
constructor(w, h) {
this.w = w;
this.h = h;
}
}
Rectangle.prototype.area = function () {
return this.w * this.h;
}
class Square extends Rectangle {
constructor(s) {
super();
this.h = s;
this.w = s;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment