what does the this keyword do in javascript code example
Example 1: js this in object
var wF = {
w : 560,
h : function() { return (312 - 42) / (560 / this.w) + 42; }
};
alert(wF.h())
Example 2: this javascript
// Im Webbrowser ist das window Objekt das globale Objekt:
console.log(this === window); // true
a = 37;
console.log(window.a); // 37
this.b = "MDN";
console.log(window.b); // "MDN"
console.log(b); // "MDN"