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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:33:28+00:00 2026-06-16T01:33:28+00:00

So I have been doing a lot of reading about the prototype and I

  • 0

So I have been doing a lot of reading about the prototype and I get it for the most part, I mean, I get the following.

var Animal = function(species) {
    this.species = species;
};
Animal.prototype.getSpecies = function() {
    return this.species;
}
var myDog = new Animal("Anderson");    
alert(myDog.getSpecies());

I even understand that I could create a new species and set the prototype to Animal and then be able to call getSpecies(). Yeah!

What confuses me is this:

var Person = function(firstName, lastName) {
    this.firstName= firstName;
    this.lastName= lastName
};

var meToo = { fName: "ken", lName: "N" };
alert(meToo.constructor.prototype);  // [object Object]
alert(Person.constructor.prototype); // function Empty(){}

http://jsfiddle.net/r0k3t/s8Sx7/9/

I was trying to find something that explains why the prototype for Person is function() {}? I thought it would be set to the global object, ‘this’ (which in this case is window). Also – why can’t I enumerate the properties of it? Reading this would suggest that I could use constructor.prototype to retrieve the object which I thought would be ‘window’ and then just enumerate the properties.

So clearly I am missing something – thanks!

  • 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-16T01:33:29+00:00Added an answer on June 16, 2026 at 1:33 am

    The prototype for Person objects, is just Person.prototype. Not Person.constructor.prototype, which is very different:

    Person.constructor, is the Function function, which constructs all functions. Because Person is a function, its .constructor is Function.

    The prototype of Function objects (all functions), is just Function.prototype. So, Person.constructor.prototype === Function.prototype.

    The constructor of plain objects is the Object function. The prototype of all plain objects is Object.prototype, which is an "[object Object]" (Prefer console.dir over alert, to see more).

    By plain object, I mean anything created with {} or new Object()

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

Sidebar

Related Questions

So I have been doing a lot of reading about the way iOS handles
I have been doing a lot a reading about unit testing. Unit testing seems
So I've been doing a lot of reading. And I have been able to
I have been doing a lot of reading but I have not been able
I am fairly new to Qt and have been doing a lot of reading
I have been doing a lot of reading and tutorials on Dependency Injection via
I've been doing a lot of reading about repository pattern (Linq2SQL or EF). I've
I have been doing a lot of reading but not coming up with any
I have been doing a lot of reading on service layers and business layers
I've been doing a lot of reading about how using singleton classes is becoming

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.