Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First, the <code>function Empty() {}</code> representation is <a href="http://code.google.com/p/v8/">V8</a> stuff.</p> <p>In V8, the <code>Function.prototype</code> object has <code>"Empty</code>" as the value of the <code>Function.prototype.name</code> property, so I guess you are probably using the Chrome's Developer Console, and it displays the name of the function in this way.</p> <p>The <code>name</code> property of function objects is <code>non-standard</code> (not part of ECMA-262), that's why we see differences between implementations.</p> <p>Now, <code>Function.prototype</code> is a function, that returns always <code>undefined</code> and can accept any number of arguments, but why?. Maybe just for consistency, every built-in constructor's prototype is like that, <code>Number.prototype</code> is a <code>Number</code> object, <code>Array.prototype</code> is an <code>Array</code> object, <code>RegExp.prototype</code> is a <code>RegExp</code> object, and so on...</p> <p>The only difference (for example, between any function object and <code>Function.prototype</code>) is that obviously <code>Function.prototype</code> inherits from <code>Object.prototype</code>.</p> <blockquote> <p>it seems everything in javascript start from Object.prototype, am I right about that?</p> </blockquote> <p>Well, you're right <code>Object.prototype</code> is the last object of the prototype chain of most objects, but in ECMAScript 5, you can even create objects that doesn't inherit from anything (just like <code>Object.prototype</code> is), and form another inheritance chain, e.g.:</p> <pre><code>var parent = Object.create(null), child = Object.create(parent); Object.prototype.isPrototypeOf(parent); // false Object.getPrototypeOf(parent); // null Object.getPrototypeOf(Object.prototype); // null </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload