What does "this" refer to in the code of page 168
Background info: author has summarized 4 scenarios of "this" on page 131. In short, a)in a regular function b)in a method of a object c)in constructor function and d)when bind is used.
"this" is used in 2 places in this code:
1) var contact = this.serializeForm();
Is "this" a a) regular function? If it's in a regular function, it refers to window object. Does window object have access to serializeForm()?
2) ...}.bind(this)
bind() is called on function(evt). function(evt) is an event listener or callback function to handle click event of submit button. On page 131, author says that "this" when used with bind() refers to the object passed as an argument into bind(). But what is this object that "this" refers to?
|