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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:12:20+00:00 2026-06-03T01:12:20+00:00

I know that in Javascript we can create ,instatnces of object like var ins

  • 0

I know that in Javascript we can create ,instatnces of object like

var ins = new myObject();

I know that ,window ,document etc are predefined objects in javascript..Can we create new instances of these objects.?
For ex:
Is

var inss = new document();

possible?

  • 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-03T01:12:22+00:00Added an answer on June 3, 2026 at 1:12 am

    Don’t confuse objects with constructors (or classes in most OOP languages). In JavaScript, you create objects by calling constructor functions using the new operator:

    function MyObject()
    {
    }
    
    var obj = new MyObject();
    

    Afterwards you can access the constructor given the object using the constructor property:

    var ctor = obj.constructor;  // (ctor === MyObject) will be true
    

    Theoretically, you can create new objects of the same type as a given object:

    var obj1 = new MyObject();
    var obj2 = new obj1.constructor();
    

    In your case, you might try the same with “built-in” object, but it will probably not work since the script engine might forbid it. For example, Chrome will throw TypeError: Illegal constructor when trying to create a new document using new document.constructor(). This is because document‘s constructor, HTMLDocument, is not meant to be used directly.

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

Sidebar

Related Questions

I know that I can create an associative array like this: var MyAssocArray =
I know that I can create a javascript replace like this: str = str.replace(/mytarget/g,
I like that in javascript, I can create a function, and then add further
In javascript you can easily create objects and Arrays like so: var aObject =
I know that javascript, for example supports functions inside of functions, like so: function
I know that in Javascript document.location.href = #my_id tells the browser to display the
I know that you can create 'server-side comments' (they won't be sent as comments/text
I know that I can create this JSON: [ { Title: Something, Price: 234,
I know you can create literal objects with subobjects and functions: var obj =
I know that in jQuery you can use something like $(.cssClass) to get all

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.