Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function User(name){
- this.name = name;
- }
- User.prototype.hello = function(who){
- console.log("Hello, " + who.name);
- };
- var vasya = new User("Вася");
- var petya = new User("Петя");
- vasya.hello(petya);
- petya.hello(vasya);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement