Created
May 29, 2020 17:21
-
-
Save harabchuk/e079dcfaf6c014d803f17ce26f826f6a to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/yusezag
This file contains hidden or 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> | |
<button>Click</button> | |
<script src="https://fb.me/react-with-addons-15.1.0.js"></script> | |
<script src="https://fb.me/react-dom-15.1.0.js"></script> | |
<script id="jsbin-javascript"> | |
class Person { | |
constructor(name) { | |
this.name = name; | |
} | |
greet() { | |
console.log(`Hello ${this.name}`); | |
} | |
} | |
class AgePerson extends Person { | |
constructor(name, age) { | |
super(name); | |
this.age = age | |
} | |
greet() { | |
super.greet() | |
console.log(`Your age is ${this.age}`); | |
} | |
} | |
const ap = new AgePerson('Max', 27 ); | |
ap.greet(); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">class Person { | |
constructor(name) { | |
this.name = name; | |
} | |
greet() { | |
console.log(`Hello ${this.name}`); | |
} | |
} | |
class AgePerson extends Person { | |
constructor(name, age) { | |
super(name); | |
this.age = age | |
} | |
greet() { | |
super.greet() | |
console.log(`Your age is ${this.age}`); | |
} | |
} | |
const ap = new AgePerson('Max', 27 ); | |
ap.greet();</script></body> | |
</html> |
This file contains hidden or 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(name) { | |
this.name = name; | |
} | |
greet() { | |
console.log(`Hello ${this.name}`); | |
} | |
} | |
class AgePerson extends Person { | |
constructor(name, age) { | |
super(name); | |
this.age = age | |
} | |
greet() { | |
super.greet() | |
console.log(`Your age is ${this.age}`); | |
} | |
} | |
const ap = new AgePerson('Max', 27 ); | |
ap.greet(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment