Is the keyword (or method?) prototype in jquery kind of like extension methods?
i.e. all classes will have this functionality available to it going forward?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is part of javascript and not specific to jquery.
the
prototypeproperty defines methods and properties shared by all objects of that type.e.g.
All instances of
MyClasswill have (share) the methodmyMethod().Note that methods on the prototype do not have the same visibility as methods declared within the constructor.
For example: