javascript - What is variable f supposed to contain in this example? -


I try to see what the logic behind the jQuery plugin is, and I'm stacking up with the following problem.

I have the following code, and I can not determine the variable f inside variable t = function (u, a) {}

  (function ($) {$ .fn.pluginName = function (userOptions) {... if ((typeof userOptions) .mail ("object | undefined")) {this return .Each (function (e) {new t (this, user option)}}} t = function (u, a) {var f = this;} ...}}) (jquery)   

should have a reference in the function t or it should have a reference on pluginName

Does anyone Help me with I'm completely confused with it.

It looks like the function T is the constructor function, which means that this inside the function will refer to the example that is applied to the code by the new keyword. / P>

Therefore, f will reference an example of an object whose constructor function is t .

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -