Skip to content

Commit 9e4832f

Browse files
committed
overriding
1 parent cdb65ea commit 9e4832f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

MethodOverriding.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class Employee {
22
constructor(name) {
3-
console.log(`${name} - Employee's constructor is here`);
3+
console.log(`${name} - Employee's constructor is here.`);
44
this.name = name;
55
}
66
login() {

OverridingConstructor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Programmer extends Employee {
2020
constructor(name) {
2121
// this.name; // it will give error, as this must be written after super constructor.
2222
super(name); // must utilize this constructor
23-
console.log(`This is a newly written constructor`);
23+
console.log(`This is a newly written constructor.`);
2424
}
2525
// constructor(...args){ ---> If there is no constructor in the child class, this is created automatically
2626
// super(...args)

0 commit comments

Comments
 (0)