js 原型链
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <script type="text/javascript"> var person = function (name) { this.name = name; }; person.prototype.getName = function() { return this.name; }; var student = new person('jerome'); console.log(student); // person { name: 'jerome' } console.log(student.prototype); //undefined, 对象原型没有prototype console.log(student.__proto__); // person {} console.log(person); // function person(name) console.log(person.prototype); // person {} console.log(person.__proto__); // function Empty() console.log(person