Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8969593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:36:54+00:00 2026-06-15T17:36:54+00:00

Is there some sort of standard or convention on naming JavaScript prototypes? I find

  • 0

Is there some sort of standard or convention on naming JavaScript prototypes?

I find myself in the need to add methods on prototypes of both native and user-defined functions quite often, and so I usually store the prototypes themselves in local variables:

var functionPrototype = Function.prototype;
var objectPrototype = Object.prototype;
var arrayPrototype = Array.prototype;

Although the names are very descriptive, they are unnecessarily long.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:36:55+00:00Added an answer on June 15, 2026 at 5:36 pm

    I believe that there’s no standard convention on naming prototype objects. So I created my own standard.

    As I mentioned in my comment above choosing a standard is just a matter of style or preference. However once you choose one you should stick to it.

    Here’s the standard I use now:

    var functProto = Function.prototype;
    var objectProto = Object.prototype;
    var arrayProto = Array.prototype;
    
    var boolProto = Boolean.prototype;
    var numberProto = Number.prototype;
    var stringProto = String.prototype;
    
    var classProto = Class.prototype;
    var rectProto = Rectangle.prototype;
    var myClassProto = MyClass.prototype;
    

    In general here are the guidelines for naming a prototype:

    1. It should be in camel case.
    2. It should end in Proto.
    3. If the abbreviation of the constructor name is more than 3 characters then use it.
    4. Otherwise use the full name of the constructor.

    This keeps very long constructor names like Function, Boolean and Rectangle short while keeping longer names long.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is there a way in .NET (or some sort of standard extension methods) to
Is there any standard way of implementing some sort of a write-through buffer for
What I'm trying to find out is whether there is some sort of equivalence
Is there a way to run some sort of code analysis to find code
I am wondering if there is some sort of standard for storing US addresses
Is there some sort of C# directive to use when using a development machine
Is there some sort of exception in Java to catch an invalid Date object?
Is there some sort of HTML designer (WYSIWYG) available that allows me to draw
So is there some sort of built in checking in Dday iCalendar that checks
#foo { color:black; } Is there some sort of option to prefix a newline

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.