Skip to content

Instantly share code, notes, and snippets.

@sherazlodhi
Last active November 22, 2015 07:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sherazlodhi/0dd00b3128fced6bd920 to your computer and use it in GitHub Desktop.
Save sherazlodhi/0dd00b3128fced6bd920 to your computer and use it in GitHub Desktop.
"use strict";
class Rectangle {
constructor(length,width) {
this.length = length;
this.width = width;
}
area() {
console.log(this.width * this.length);
}
}
class Square extends Rectangle {
constructor(length){
//super();
this.length= length;
}
area() {
console.log(this.length * this.length );
}
}
var r = new Rectangle(10,44);
r.area();
var s = new Square(10);
s.area();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment