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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:34:17+00:00 2026-06-08T09:34:17+00:00

In this answer, I instructed the questioner not to overwrite the native Object function

  • 0

In this answer, I instructed the questioner not to overwrite the native Object function in Javascript, because I thought that it would mess up the object creation process.

But then, I thought about it, and figured that it’s pretty unlikely that all objects are actually created using this function, along with the new keyword.

For example, is it used when objects are created with a literal notation (var a = {...})? Or does it simply do this = {}? Is it possible to actually assign values to this at all?

I saw this question, that is similar, and apparently Object behaves differently when used without the new keyword… How is the function actually implemented?

  • 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-08T09:34:21+00:00Added an answer on June 8, 2026 at 9:34 am

    You can overwrite Object in Chrome/V8 and bad things happen if you do. Typing the following gets these responses.

    > Object
     function Object() { [native code] }
    > Number
     function Number() { [native code] }
    

    Looking at Number.prototype we can see a full set of methods and Object as Number’s prototype:

    Number
    constructor: function Number() { [native code] }
    toExponential: function toExponential() { [native code] }
    toFixed: function toFixed() { [native code] }
    toLocaleString: function toLocaleString() { [native code] }
    toPrecision: function toPrecision() { [native code] }
    toString: function toString() { [native code] }
    valueOf: function valueOf() { [native code] }
    __proto__: Object
      __defineGetter__: function __defineGetter__() { [native code] }
      __defineSetter__: function __defineSetter__() { [native code] }
      __lookupGetter__: function __lookupGetter__() { [native code] }
      __lookupSetter__: function __lookupSetter__() { [native code] }
      constructor: function Object() { [native code] }
      hasOwnProperty: function hasOwnProperty() { [native code] }
      isPrototypeOf: function isPrototypeOf() { [native code] }
      propertyIsEnumerable: function propertyIsEnumerable() { [native code] }
      toLocaleString: function toLocaleString() { [native code] }
      toString: function toString() { [native code] }
      valueOf: function valueOf() { [native code] }
    

    But if we overwrite Object

    Object = {}
    

    Number’s prototype goes a bit wonky:

    Number.prototype
       > Number
    
      ...empty...
    

    As Object is the root of the hierarchy there’s a bit of a paradox if you reassign it to another object.

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

Sidebar

Related Questions

This answer of mine generated some comments claiming that the following construct is not
in this answer he said that i can use RIA services while creating my
I am not sure if there's an answer for this already -- couldn't find
Given this answer: https://stackoverflow.com/a/4263048 Which is excellent, how can we be sure that out
From this Answer , I came to know that KeyValuePair are immutables. I browsed
This answer to a question about C++ unit test frameworks suggests a possibility that
This answer wrote that WPF has the Dispatcher class. What does that mean?
In this answer to a Meta question , Jeff states that he has fixed
In this answer to a separate question , I said that if you do
This answer works almost perfectly for my needs. The problem is that it will

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.