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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:29:39+00:00 2026-05-23T21:29:39+00:00

I have read that Javascript’s inheritance is prototypal.What does it mean?How can an object

  • 0

I have read that Javascript’s inheritance is prototypal.What does it mean?How can an object defined by the programer inherit the properties of a predefined object such as window ?
For example I need the function eval() in my own class . How can it be achieved?

  • 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-23T21:29:40+00:00Added an answer on May 23, 2026 at 9:29 pm

    What do you want exactly echieve to?
    Here is the simplest way (not the best) of prototype inheritance:

    var obj1=new Object1Constructor();
    var obj2=new Object2Constructor();
    
    obj2.prototype=obj1;
    

    It means that obj1 inherits all properties of obj2

    I’ve forgot the main thing: eval==evil;

    UPDATE:
    I’ve made mistakes in the code above. That is not inheritance. Here is updated code:

    var Object1Constructor=function(){ // one object constuctor
        //properties definition goes here
    }
    
    var Object2Constructor=function(){ // another object constuctor
        //properties definition goes here
    }
    
    Object2Constructor.prototype=new Object1Constructor();
    
    var obj=new Object2Constructor();
    

    And that is inharitance. Now obj has properties defined in Object2Constructor and Object1Constructor – parent ‘class’.
    See CMS’s comment below. He is totally right.

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

Sidebar

Related Questions

I've read that JavaScript does not really have static variables(when i say static, I
I have read that you can do it, but would this really improve performance
I have read that gwt-ext is slow and it seems too bulky. How does
I have read somewhere that javascript and css files that only get cached in
I have read about Crockford's push for using JavaScript in a more obviously prototypal
I have to maintain a JavaScript object with some 30-40 properties, which I update
I have a question on rollover effects using JavaScript. I have read that image
I have read that a HTTP server created in node.js does not create new
I have read that using database keys in a URL is a bad thing
I have read that while plug-ins are not supported for SQL Server Management Studio,

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.