diff --git a/arrow3.js b/arrow3.js new file mode 100644 index 0000000..0a9a39d --- /dev/null +++ b/arrow3.js @@ -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. \ No newline at end of file diff --git a/class.js b/class.js index 7acf969..1a0ea98 100644 --- a/class.js +++ b/class.js @@ -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"); diff --git a/const.js b/const.js index 7dbf47b..cfba2f1 100644 --- a/const.js +++ b/const.js @@ -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 @@ -13,5 +18,7 @@ console.log(city); const city = ['Galle', 'Kandy']; city.push('Colombo'); +city.push('Maruthamunai'); + console.log(city);