GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Added inheritance demo · MorrielAlexis/JavaScript-Lessons@beef302

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • ES6
    • Arrow_Functions
      • README.md
      • main.js
    • Classes
      • README.md
      • index.html
      • main.js
    • Constants
      • README.md
      • main.js
    • Inheritance
      • README.md
      • index.html
      • main.js
    • Let
      • README.md
      • main.js
    • Spread_Operator
      • README.md
      • index.html
      • main.js
    • Template_Literals
      • README.md
      • main.js
  • _template_html
    • README.md
    • index.html
    • main.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Arrow_Functions/README.md‎ ‎ES6/Arrow_Functions/README.md‎Arrow_Functions/README.md renamed to ES6/Arrow_Functions/README.md

Copy file name to clipboard
  • Display the source diff
  • Display the rich diff
File renamed without changes.
Collapse file

‎Arrow_Functions/main.js‎ ‎ES6/Arrow_Functions/main.js‎Arrow_Functions/main.js renamed to ES6/Arrow_Functions/main.js

Copy file name to clipboard
File renamed without changes.
Collapse file

‎Constants/README.md‎ ‎ES6/Classes/README.md‎Constants/README.md renamed to ES6/Classes/README.md

Copy file name to clipboard
  • Display the source diff
  • Display the rich diff
File renamed without changes.
Collapse file

‎ES6/Classes/index.html‎

Copy file name to clipboard
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>JavaScript</title>
6+
<script src="main.js"></script>
7+
</head>
8+
<body>
9+
10+
</body>
11+
</html>
Collapse file

‎ES6/Classes/main.js‎

Copy file name to clipboard
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"use strict";
2+
3+
class Person{
4+
5+
constructor(name, age, weight){
6+
this.name = name;
7+
this.age = age;
8+
this.weight = weight;
9+
}
10+
11+
displayWeight(){
12+
console.log(this.weight)
13+
}
14+
15+
}
16+
17+
let bucky = new Person('Bucky Roberts', 87, 562);
18+
bucky.displayWeight();
Collapse file

‎Template_Literals/README.md‎ ‎ES6/Constants/README.md‎Template_Literals/README.md renamed to ES6/Constants/README.md

Copy file name to clipboard
  • Display the source diff
  • Display the rich diff
File renamed without changes.
Collapse file

‎Constants/main.js‎ ‎ES6/Constants/main.js‎Constants/main.js renamed to ES6/Constants/main.js

Copy file name to clipboard
File renamed without changes.
Collapse file

‎ES6/Inheritance/README.md‎

Copy file name to clipboard
+3Lines changed: 3 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Title
2+
3+
Description
Collapse file

‎ES6/Inheritance/index.html‎

Copy file name to clipboard
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>JavaScript</title>
6+
<script src="main.js"></script>
7+
</head>
8+
<body>
9+
10+
</body>
11+
</html>
Collapse file

‎ES6/Inheritance/main.js‎

Copy file name to clipboard
+42Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
"use strict";
2+
3+
class Person{
4+
5+
constructor(name, age, weight){
6+
this.name = name;
7+
this.age = age;
8+
this.weight = weight;
9+
}
10+
11+
displayWeight(){
12+
console.log(this.weight)
13+
}
14+
15+
}
16+
17+
class Programmer extends Person{
18+
19+
constructor(name, age, weight, language){
20+
super(name, age, weight);
21+
this.language = language;
22+
}
23+
24+
displayAge(){
25+
console.log(this.age);
26+
}
27+
28+
displayLanguage(){
29+
console.log(this.language);
30+
}
31+
32+
}
33+
34+
let sally = new Person('Sally Jones', 32, 99);
35+
sally.displayWeight();
36+
37+
console.log('----------');
38+
39+
let bucky = new Programmer('Bucky Roberts', 87, 562, 'JavaScript');
40+
bucky.displayWeight();
41+
bucky.displayAge();
42+
bucky.displayLanguage();

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.