How can I use subclass property in jQuery.sub method ?
Hi.
I read jQuery core.js(1.5) last month with my friends who love it. :-)
We were not sure what is the code of "jQuerySubclass.subclass = this.subclass;" in the jQuery.sub method.
How can I use it and what is the meaning of this substitution.
I checked unit test of core.js, but I have no idea.
If I don't set any value to jQuery.subclass, subclass property of the sub-class is undefined.
- var subClass = $.sub();
- subClass.subclass; // => undefined
- subClass.subclass = "subClassName";
- var subsubClass = subClass.sub()
- subsubClass.subclass // => "subClassName"
- var subsubsubClass = subsubClass.sub()
- subsubsubClass.subclass // => "subClassName"
What is the advantage of subclass property ?
Best regards.