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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:38:42+00:00 2026-05-23T00:38:42+00:00

If I write this var o = Object.create(null) alert(o instanceof Object) // this is

  • 0

If I write this

var o = Object.create(null)
alert(o instanceof Object) // this is false

How come this ends up being true

function o() {

}
o.prototype = null
alert(new o() instanceof Object) // this is true

Shouldn’t manually setting the prototype to null cause it to inherit from nothing as Object.create does. Thanks in advance 🙂

  • 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-23T00:38:42+00:00Added an answer on May 23, 2026 at 12:38 am

    Briefly, if a constructor’s prototype isn’t an Object, then instances are given Object.prototype as their [[prototype]].

    The detail is in ECMA-262, §13.2.2 [[Construct]]:

    When the [[Construct]] internal method
    for a Function object F is called with
    a possibly empty list of arguments,
    the following steps are taken:

    1. Let obj be a newly created native ECMAScript object.
    2. Set all the internal methods of obj as specified in 8.12.
    3. Set the [[Class]] internal property of obj to “Object“.
    4. Set the [[Extensible]] internal property of obj to true.
    5. Let proto be the value of calling the [[Get]] internal property of F
      with argument “prototype“.
    6. If Type(proto) is Object, set the [[Prototype]] internal property of obj
      to proto.
    7. If Type(proto) is not Object, set the [[Prototype]] internal property of
      obj to the standard built-in Object
      prototype object as described in
      15.2.4.
    8. Let result be the result of calling the [[Call]] internal property
      of F, providing obj as the this value
      and providing the argument list passed
      into [[Construct]] as args.
    9. If Type(result) is Object then return result.
    10. Return obj.

    Noting that in items 6 and 7, null is Type null (ECMA-262 §8.2), it is not the same as typeof null, which is object.

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

Sidebar

Related Questions

Does anyone know how to write this var q = from c in customers
If I write something like this: var img = $(new Image()).attr('src', image.src); How can
How to write this JavaScript code without eval? var typeOfString = eval(typeof + that.modules[modName].varName);
For some reason I'm not getting this. (Example model below) If I write: var
$(function(){ $('a').each(function(){ var x=this.href; this.href=www.somesitename.com/filter+this.href; }); }); i wrote the above jQuery script to
I would like to write this as a user defined function: private double Score(Story
Consider this code: // Creating an empty object, without inheriting (binding) to any prototype
I'm trying to replace this: void ProcessRequest(object listenerContext) { var context = (HttpListenerContext)listenerContext; Uri
I write this in api v2: map.enableGoogleBar(); I want to using v3, but I
I could probably write this myself, but the specific way I'm trying to accomplish

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.