This commit is contained in:
Ilya Kantor 2021-03-26 09:27:02 +03:00
parent b2bff50f56
commit 7b76185892

View file

@ -110,7 +110,7 @@ alert(typeof User); // function
alert(User === User.prototype.constructor); // true
// The methods are in User.prototype, e.g:
alert(User.prototype.sayHi); // alert(this.name);
alert(User.prototype.sayHi); // the code of the sayHi method
// there are exactly two methods in the prototype
alert(Object.getOwnPropertyNames(User.prototype)); // constructor, sayHi