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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:03:47+00:00 2026-05-28T13:03:47+00:00

I am currently reading ‘Javascript Good Parts’, and I came across the following paragraph

  • 0

I am currently reading ‘Javascript Good Parts’, and I came across the following paragraph

If we try to retrieve a property value from an object, and if the
object lacks the property name, then JavaScript attempts to retrieve
the property value from the prototype object. And if that object is
lacking the property, then it goes to its prototype, and so on until
the process finally bottoms out with Object.prototype.

If I create an object obj2 from obj1 as prototype, does that mean obj1 cannot be destroyed until obj2 also goes out of scope?

  • 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-28T13:03:48+00:00Added an answer on May 28, 2026 at 1:03 pm

    As long as you’ve built your object’s inheritance (linked the prototypes), I don’t think that the browser relies on your references to that object.

    ex1 :

    var a = function(){};
    a.prototype.toString = function(){return "I'm an A!";};
    var b = new a();
    a = undefined;
    var c = new a();// error => a is not a function any more!
    b.toString();// it works because the prototype is not destroyed, 
                 // only our reference is destroyed
    

    ex2 :

    var a = function(){};
    a.prototype.toString = function(){return "I'm an A!";};
    var b = function(){};
    b.prototype = new a();
    a = undefined;
    var c = new b();
    console.log(c+'');// It still works, although our 
                      // initial prototype `a` doesn't exist any more.
    

    UPDATE:
    This behaviour might be related to the fact that in javascript you can’t exactly destroy an object; you can only remove all references to it. After that, the browser decides how to deal with the unreferenced objects through it’s Garbage collector.

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

Sidebar

Related Questions

I am currently reading the book Javascript: The Good Parts and was playing with
I'm currently reading through this jquery masking plugin to try and understand how it
I am currently reading a book on Javascript by Pragmatic, and I'm confused about
I am currently reading an WPF tutorial and i don't fully understand the following
I'm currently reading 'Javascript Web Applications' (O'Reilly, Alex MacCaw) and very early on there's
I'm currently reading in a text file containing the following lines: 0 24000 97200
I am currently reading Effective C# and found the following line very confusing: Last,
The book I'm currently reading has me write the following code : -(IBAction)displaySomeText:(id)sender {
I am currently reading in a public key file using the following code: //
im currently reading a book about programming Android and there is a nice little

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.