Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!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">
- // const myName = (name, age) => {
- // console.log(name, age);
- // }
- // myName('Dev', 35);
- class Human {
- constructor() {
- this.city = 'Sunnyvale';
- }
- printCity() {
- console.log(this.city);
- }
- }
- class Person extends Human {
- constructor() {
- super();
- this.name = 'Dev';
- this.age = 30;
- }
- printMyInfo() {
- console.log(this.name);
- console.log(this.age);
- }
- }
- const person = new Person();
- person.printMyInfo();
- </script>
- <script id="jsbin-source-javascript" type="text/javascript">// const myName = (name, age) => {
- // console.log(name, age);
- // }
- // myName('Dev', 35);
- class Human {
- constructor() {
- this.city = 'Sunnyvale';
- }
- printCity() {
- console.log(this.city);
- }
- }
- class Person extends Human {
- constructor() {
- super();
- this.name = 'Dev';
- this.age = 30;
- }
- printMyInfo() {
- console.log(this.name);
- console.log(this.age);
- }
- }
- const person = new Person();
- person.printMyInfo();</script></body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement