The typeof operator applied to a jQuery object returns the string "function" . This basically means jQuery is a function.
But the typical type stops. Unlike statically typed languages, the number, order, modes and types of parameters are not taken into account when calculating the type of function a. In JavaScript, this is simply a βfunctionβ.
When you create a function in JavaScript, the created function object receives two properties: length and prototype , and its prototype has the value Function.prototype , so it inherited properties such as apply and call .
And as others have already answered, feel free to add your own properties. a function is just an object.
But be careful with the "type." Technically, only SIX exists in JavaScript: Null, Undefined, Boolean, Number, String, and Object. So, the real answer to your question, what is the exact jQuery type, is ... actually ... drumroll .... Object .
source share