Created
January 6, 2018 06:11
-
-
Save eboominathan/7fae76af632c78ab678cceb9fa3cedc5 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/jejizer
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
class Person{ | |
constructor(){ | |
this.name = 'Boomi'; | |
} | |
printMyname(){ | |
console.log(this.name); | |
} | |
} | |
class Human extends Person{ | |
constructor(){ | |
super(); | |
this.name = 'Test'; | |
} | |
printMyname(){ | |
console.log(this.name); | |
} | |
} | |
const person = new Person(); | |
const human = new Human(); | |
person.printMyname(); | |
human.printMyname(); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">class Person{ | |
constructor(){ | |
this.name = 'Boomi'; | |
} | |
printMyname(){ | |
console.log(this.name); | |
} | |
} | |
class Human extends Person{ | |
constructor(){ | |
super(); | |
this.name = 'Test'; | |
} | |
printMyname(){ | |
console.log(this.name); | |
} | |
} | |
const person = new Person(); | |
const human = new Human(); | |
person.printMyname(); | |
human.printMyname(); | |
</script></body> | |
</html> |
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
class Person{ | |
constructor(){ | |
this.name = 'Boomi'; | |
} | |
printMyname(){ | |
console.log(this.name); | |
} | |
} | |
class Human extends Person{ | |
constructor(){ | |
super(); | |
this.name = 'Test'; | |
} | |
printMyname(){ | |
console.log(this.name); | |
} | |
} | |
const person = new Person(); | |
const human = new Human(); | |
person.printMyname(); | |
human.printMyname(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment