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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:17:57+00:00 2026-06-11T15:17:57+00:00

Every function-constructor in JS has a prototype.constructor property. And it stores the definition of

  • 0

Every function-constructor in JS has a prototype.constructor property. And it stores the definition of the function:

function Rabbit(value) {
    this.jumps: value;
}
alert(Rabbit.prototype.constructor);  // alerts exactly the definition of the Rabbit function

Now I check a simple function, not a function-constructor, it doesn’t have any this in the body:

function bar(val) {
    alert(val);
}
alert(bar.prototype.constructor);   // behavior is absolutely the same: it alerts the definition of bar

Now I check built-in Array() function:

alert(Array.prototype.constructor);  // in Chrome it alerts "function Array() { [native code] }"

And now I want to check some built-in function of a built-in object:

// The error is thrown in console: TypeError: Cannot read property 'constructor' of undefined 

alert(Array.prototype.sort.prototype.constructor);

sort doesn’t have prototype. Where is it? And where is its constructor?

  • 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-11T15:17:59+00:00Added an answer on June 11, 2026 at 3:17 pm

    If you add the method yourself it returns what you expect:

        Array.prototype.remove= function(){
            var what, a= arguments, L= a.length, ax;
            while(L && this.length){
                what= a[--L];
                while((ax= this.indexOf(what))!= -1) this.splice(ax, 1);
            }
            return this;
        }
    
    
    alert(Array.prototype.remove.prototype.constructor);
    

    Non-enumerable methods do not expose their code

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

Sidebar

Related Questions

This figure again shows that every object has a prototype. Constructor function Foo also
Javascript has a poorly constructed but convenient arguments variable inside every function, such that
Say I have a class like this: class Person { private $value; public function
when ever a function has a object passed by value it uses either copy
I'm looking for a tool that will tell/resolve for every function all the call
Is there any need for code with author's name added in every function or
Where can I store folder's paths, which can be accessed from every function/variable in
I have experience with OCaml. You had to write a stub for every function
I need to call a function every 5 minutes for an 8 hour period.
I want to make a function that automatically turns every Math function global example:

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.