__proto__ of a function

Posted by alter on Stack Overflow See other posts from Stack Overflow or by alter
Published on 2010-05-20T08:57:34Z Indexed on 2010/05/20 9:00 UTC
Read the original article Hit count: 200

Filed under:

if I have a class called Person. var Person = function(fname, lname){

this.fname = fname;

this.lname = lname;

}

Person.prototype.mname = "Test"; var p = new Person('Alice','Bob'); Now, p.proto refers to prototype of Person but, when I try to do Person.proto , it points to function(), and Person.constructor points to Function().

can some1 explain what is the difference between function() and Function() and why prototype of a Function() class is a function()

© Stack Overflow or respective owner

Related posts about JavaScript