Closed wonderfan closed 9 years ago
At the first glance, I thought it was something related to Object.prototype.constructor
, but it's not.
The Constructor
here has nothing to do with Javascript language itself, I believe it's some pattern, convention or best practice.
I didn't do jquery plugins for years, but here's a piece of info might help essential-jquery-plugin-patterns.
If you insist, you can share the full source of the plugin with a gist, so I can look into the internals, and try to figure it out.
It is boostrap ScrollSpy and you can read it in the boostrap code repository directly
I think it should be lower case instead of upper case. When creating the JavaScript instance, it will use new keyword and constructor to initialize the object.
In the jQuery framework, the plugin function usually has one attribute named Constructor and it is function type. What is its purpose?
for example: