Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions arrow3.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const print = {
function1: function() {
console.log('This is the Function Belongs to ', this);
},

function2: () => {
console.log('This is the Function 2', this);
}
}

print.function1();
print.function2();

//this keyword wont work with arrow function.
1 change: 1 addition & 0 deletions class.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Manager extends Employee {
const e1 = new Employee("Safnaj");
const e2 = new Manager("Safnaj", "RPA");


e1.display();
e2.display();
e2.display = () => console.log("this function is override");
Expand Down
7 changes: 7 additions & 0 deletions const.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/*
If its a const we can not change
*/
let newCity = "Maruthamunai";
newCity = "Kalmunai" // This can be changed

var newCity1 = "Kandy";
newCity1 = "Dambull" // This can be changed

const city = "Colombo";
city = 'Galle'; //Error
Expand All @@ -13,5 +18,7 @@ console.log(city);

const city = ['Galle', 'Kandy'];
city.push('Colombo');
city.push('Maruthamunai');

console.log(city);