Last active
November 22, 2015 07:55
-
-
Save sherazlodhi/0dd00b3128fced6bd920 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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