Skip to content

Instantly share code, notes, and snippets.

@kwarodom
Created October 8, 2020 06:57
Show Gist options
  • Save kwarodom/12ccb25bcc30923519968eb9213ca46b to your computer and use it in GitHub Desktop.
Save kwarodom/12ccb25bcc30923519968eb9213ca46b to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/pukiyukera
<!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 Human {
//ES7
gender='male';
printGender = () => {
console.log(this.gender);
}
}
class Person extends Human {
name='Max';
gender='female'
printMyName = () => {
console.log(this.name);
}
}
const person = new Person();
person.printMyName();
console.log(person.name)
person.printGender()
</script>
<script id="jsbin-source-javascript" type="text/javascript">class Human {
//ES7
gender='male';
printGender = () => {
console.log(this.gender);
}
}
class Person extends Human {
name='Max';
gender='female'
printMyName = () => {
console.log(this.name);
}
}
const person = new Person();
person.printMyName();
console.log(person.name)
person.printGender()</script></body>
</html>
class Human {
//ES7
gender='male';
printGender = () => {
console.log(this.gender);
}
}
class Person extends Human {
name='Max';
gender='female'
printMyName = () => {
console.log(this.name);
}
}
const person = new Person();
person.printMyName();
console.log(person.name)
person.printGender()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment