Inheritance
by mshufrich
JavaScript
function Person(){}
Person.prototype.getName = function(){
return this.name;
};
function Me(name){this.name=name;}
Me.prototype = new Person();// Напишіть функцію, яка наслідується від Person
Me.prototype.setName = function(name){this.name = prompt('name?')};// і дозволяє просетити ім'я через конструктор
var me = new Me();
me.setName(name);
console.log(me.getName());