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

  • Home
  • SEARCH
  • 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 6556683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:58:34+00:00 2026-05-25T12:58:34+00:00

In JavaScript you could consider the relationship between two objects to be like a

  • 0

In JavaScript you could consider the relationship between two objects to be like a “container” and a “member”. For example:

var c1 = {m:1};

function C() {this.m = 1;} var c2 = new C();

function C() {var m = 1;} var c3 = new C();

In each of these cases there is a relationship between the c object and the m object. You could say that in first case that m is a static member of c1. In the second case m is an instance member of c2. And in the third case m is an inner member of c3.

I suspect these terms are not technically correct in the case of the JavaScript Language, but in my experience, they are in common usage and are understood by most JavaScript developers. So my question is: what single word would you use to describe all these relationships? For example, would you say the “attachment” of m to c is “static”; or the “membership” of m to c is “instance”; etc.? The ????? of m to c is “inner”? If you see what I mean.

The use case is that I am documenting a JavaScript library and I’ve chosen to organise the documented objects into containers and then, under that, into members of that container. Then I’d like to organise the members based on their “relationship” to their container: { inner, instance, or static }. Is there a word that describes that relationship?

  • 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-05-25T12:58:35+00:00Added an answer on May 25, 2026 at 12:58 pm

    I’d say, in the first case (this.m), m is a property of the object which is publicly accessible. Strictly speaking, all properties you can define are “public” because JavaScript does not have the concept of visibility.

    In the second, m is just a variable local to the constructor function. What you name it depends on what you are doing with it. If you define other, public, functions (methods) in the constructor, then you could call m a “private property“, as it is not accessible from the outside, but accessible by the methods. Although this is technically not correct, I think most people would understand what you mean. I would also mention explicitly (in a comment) that you use closures to simulate these “private properties” with local variables.

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

Sidebar

Related Questions

Consider this small snippet of JavaScript: for(var i in map.maps) { buttons.push($(<button>).html(i).click(function() { alert(i);
could anyone please tell me, where in Javascript the difference between MyClass.prototype = new
I'm specifically referring to JavaScript anonymous function but this could be relevant to other
Consider the following Javascript function (1): function setData(domElement) { domElement.myDataProperty = { 'suppose': 'this',
Does anyone have an explanation of how javascript could do this. Somehow this function
Consider this JavaScript: var number = $(.linksMiniImages a).index(this); alert (number); Alert shows -1 when
Consider this JavaScript Code: <script type=text/javascript> function loop(Message){ document.getElementById('output').innerHTML = document.getElementById('output').innerHTML + Message +
Consider this first Javascript snippet, which only uses var and this to declare scope:
This will be implemented in Javascript (jQuery) but I suppose the method could be
Consider this scenario: Using Javascript/E4X, in a non-browser usage scenario (a Javascript HL7 integration

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.