1var wF = {
2 w : 560,
3 h : function() { return (312 - 42) / (560 / this.w) + 42; }
4};
5
6alert(wF.h())
7
1In regular functions the this keyword represented the object that called the function, which could be the window, the document, a button or whatever.
2
3With arrow functions, the this keyword always represents the object that defined the arrow function.
1// Im Webbrowser ist das window Objekt das globale Objekt:
2console.log(this === window); // true
3
4a = 37;
5console.log(window.a); // 37
6
7this.b = "MDN";
8console.log(window.b); // "MDN"
9console.log(b); // "MDN"
10
1Go to This link :- https://itnext.io/the-this-keyword-in-javascript-demystified-c389c92de26d