I came across understanding how 'this' worked in javascript with detail.
in w3school it explains how this works. (http://www.w3schools.com/js/js_object_definition.asp)
"The value of this, when used in a function, is the object that "owns" the function.
The value of this, when used in an object, is the object itself."
From my understanding, object constructors are functions, not objects, and according to the definition above 'this' within the constructor, should refer to the object that owns this constructor (on a global scale, that would be the window object).
However, the 'this' refers to the object constructor function. Why is that?
function person(first, last, age) {
this.firstName = first;
this.lastName = last;
this.age = age;}
I've tried looking through other examples on stack overflow, but they don't seem to clear out this concept in detail.