Skip to content

Instantly share code, notes, and snippets.

@harabchuk
Created May 29, 2020 17:21
Show Gist options
  • Save harabchuk/e079dcfaf6c014d803f17ce26f826f6a to your computer and use it in GitHub Desktop.
Save harabchuk/e079dcfaf6c014d803f17ce26f826f6a to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/yusezag
<!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>
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