> what is the purpose of
> self = this
> I've seen it a bunch of times now, but not 100% sure what it's for.
> is it so that functions in a object retain access to the object's
> prototype/instance and would 'this' point to the prototype object of a
> function if it is not initialized with new?
function scope and global scope. If a variable is not found in the
variable or decides it doesn't exist. This is the case for most
variables, with the exception of `this` and `arguments`, which ALL
functions get. (There may be more, but I dont remember offhand)
Typically `this` can come from an instantiated object that's had a
method called on it, or someone doing a Fn.apply or Fn.call with an
explicit target object. (eg myfunction.apply(myobject, args) => this =
Therefore, in order to "hold onto" a previous scope, we just assign it
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.