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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:15:31+00:00 2026-05-27T12:15:31+00:00

I tried and got the following output: [object Object] I am familiar with adding

  • 0

I tried and got the following output:

[object Object]

I am familiar with adding new functions to Object.prototype so that every object in the program inherits that new function. But I am a bit curious to know how this has been implemented. I am guessing Object should of type

{
    name: expression,
    name: expression,
    ...
}

I am also guessing Object.prototype should be the key to one of the Object property and the value of that property is ‘[object Object]’. Now would you please let me know if my understanding is correct?

I am also wondering what is the difference between ‘object’ and ‘Object’ in ‘[object Object]’. I am also wondering if any of the above mentioned objects is related to the one preceding ‘.prototype’. Would you please clarify?

When I tried to print Object.prototype.object, Object.prototype.Object, Object.prototype[object], Object.prototype[Object], and Object.prototype[0], I am always getting undefined. If prototype doesn’t have any property, how did I get [object Object]?

  • 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-27T12:15:32+00:00Added an answer on May 27, 2026 at 12:15 pm

    The object is always there and the Object comes from the value of the [[Class]] internal property which is why

    Object.prototype.toString.call([]) === "[object Array]";
    Object.prototype.toString.call("") === "[object String]";
    Object.prototype.toString.call(new Date) === "[object Date]";
    

    It’s described in 15.2.4.2:

    15.2.4.2 Object.prototype.toString ( ) # Ⓣ Ⓔ Ⓡ

    When the toString method is called, the following steps are taken:

    1. If the this value is undefined, return "[object Undefined]".
    2. If the this value is null, return "[object Null]".
    3. Let O be the result of calling ToObject passing the this value as the argument.
    4. Let class be the value of the [[Class]] internal property of O.
    5. Return the String value that is the result of concatenating the three Strings "[object ", class, and "]".

    Internal properties are a bit confusing. You can read up on them at 8.6.2:

    This specification uses various internal properties to define the semantics of object values. These internal properties are not part of the ECMAScript language. They are defined by this specification purely for expository purposes. An implementation of ECMAScript must behave as if it produced and operated upon internal properties in the manner described here. The names of internal properties are enclosed in double square brackets [[ ]].

    Incidentally, the Object.prototype.toString.call trick is used by jQuery and other libraries in their isArray functions since the internal property is the same for all frames even though each frame has its own version of the Array builtin.

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

Sidebar

Related Questions

I tried this and got the output as: void Please explain the following Code:
I tried installing TurboGears 1.0 on Windows 7 using tgsetup.py. and got following error
I tried to update some part of a matrix, I got the following error
i downlaoded three20 p31. when i tried to build i got errors in following
I tried the following code in LINQPad and got the results given below: List<string>
I got this error when I tried to compile an application that includes the
Suppose I've got the following program: namespace ReflectionTest { public class Example { private
I've got the following bit of code that generates a list I'm trying to
I tried the following program on Visual Studio 2010. #include <iostream> using namespace std;
I got tired of writing the following code: /* Commenting out irrelevant parts public

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.