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 6592691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:35:15+00:00 2026-05-25T17:35:15+00:00

I am using constructor chaining to define a base class (Super). function Super ()

  • 0

I am using “constructor chaining” to define a base class (Super).

function Super () {
  this.member1 = 'superMember1';
  this.member2 = 'superMember2';
}

function Sub() {
  Super.call(this, arguments);
  this.member3 = 'subMember3';
  var t = this.hasOwnProperty("member1"); // gives me true, so I cannot use it
}

How can I test whether a member (1,2,3) is defined (belonging) in my Sub class or in the Super class?

Remark: `this[“name”]’ is not the way, because I can only decide whether a value has been assigned – not if it is belonging to Super or Sub.

As Darhazer comments below, constructor chaining copies the members, so it might be tricky.

  • 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-25T17:35:15+00:00Added an answer on May 25, 2026 at 5:35 pm

    Obviously as of the answers so far, not possible. Hence will be closed.

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

Sidebar

Related Questions

while using the following constructor $this->pdo = new PDO ($this->source, $this->username, $this->password); if I
Does creating an object using reflection rather than calling the class constructor result in
Can I call constructor explicitly, without using new , if I already have a
I want to populate class with constructor using FETCH_INTO of PDO: class user {
Trying hard to replace the eval without using Function constructor. Stumped. I am not
What's the advantage of using a constructor function like so: var MyLibrary = new
I can still instantiate by using constructor although in class definition it has been
I am using method chaining for my class structure. So my problem is that
I have a class A that allocates memory in its constructor using new .
is it possible to re-initialize an object of a class using its constructor?

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.