Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// Use rectangle class to find the area of Square.
class Rectangle {
constructor(w, h) {
this.w = w;
this.h = h;
// Rectangle class Method to find the area.
Rectangle.prototype.area = function() {
class Square extends Rectangle {
constructor(s) {
this.h = s;
this.w = s;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment