Function jQuery() is a factory function. Can I use it as a constructor?
var ax = jQuery('a');
var bx = new jQuery('a');
Do they have the same meaning? The new object inherit whose prototype object?
(I promise: I’ll not use it as a constructor in real life)
There’s no difference, because all it does is return something:
If constructors return
something elseanother object, that’s what’s returned and the constructed object is discarded. So… don’t usenew jQuery! 🙂