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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:38:31+00:00 2026-05-24T16:38:31+00:00

The answer to this question: What is the initial value of a JavaScript function's

  • 0

The answer to this question:
What is the initial value of a JavaScript function's prototype property?

has this sentence:

The initial value of prototype on any newly-created Function instance is a new instance of Object

As far as I know, Javascript doesn’t have classes and the word ‘instance’ therefor doesn’t make sense in my head. How should one interpret ‘instance’ in Javascript?

Sorry, I don’t have enough rep to put my question in the comment thread on that answer.

  • 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-24T16:38:32+00:00Added an answer on May 24, 2026 at 4:38 pm

    You’re right that JavaScript doesn’t have classes (yet), but it does have constructor functions, an instanceof operator that defines a relationship between objects and constructors, and a form of inheritance based on prototype chains.

    obj instanceof ctor is true when ctor.prototype is on obj‘s prototype chain.

    Modulo the caveat below, you could implement instanceof in EcmaScript 5 thus

    function isInstanceOf(obj, ctor) {
      var proto = ctor.prototype;
      if (typeof obj === "object" || typeof obj === "function") {
        while (obj) {
          if (obj === proto) { return true; }
          obj = Object.getPrototypeOf(obj);
        }
      }
      return false;
    }
    

    Unless you go around reassigning prototypes (o = new MyConstructor(); MyConstructor.prototype = somethingElse) it should be the case that new MyConstructor() instanceof MyConstructor.

    Section 15.3.5.3 explains this in detail.

    15.3.5.3 [[HasInstance]] (V)

    Assume F is a Function object.

    When the [[HasInstance]] internal method of F is called with value V, the following steps are taken:

    1. If V is not an object, return false.

    2. Let O be the result of calling the [[Get]] internal method of F with property name "prototype".

    3. If Type(O) is not Object, throw a TypeError exception.

    4. Repeat

      1. Let V be the value of the [[Prototype]] internal property of V.
      2. If V is null, return false.
      3. If O and V refer to the same object, return true.

    This isn’t the whole story because host objects (like DOM nodes) are allowed to implement the [[HasInstance]] internal method however they like but most browsers implement host objects to behave as closely to native objects as possible.

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

Sidebar

Related Questions

I think the answer to this question is so obivous that noone has bothered
I did some googling to try to answer this question but even after that
I have looked around on the Internet trying to answer this question. It seems
In answer to this question Joel Coehoorn said Finally, only after the site's gone
I already know the obvious answer to this question: just download <insert favorite windows
I'm almost certain I know the answer to this question, but I'm hoping there's
I've searched a lot for an answer for this question in the web: they
I realize there's no definitely right answer to this question, but when people talk
I am using the code I posted as an answer to this question to
I haven't found an answer to this particular question; perhaps there isn't one. But

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.