ildar-k
9/14/2018 - 3:42 PM

Object.create

const personPrototypes = {
    greeting: function(){
        return `tere tulemast ${this.firstName} ${this.lastName}`
    },
    getsMarried: function(newLastName){
        this.lastName = newLastName;
    }
}

const holly = Object.create(personPrototypes);
holly.firstName = 'Holly';
holly.lastName = 'Rye';
holly.age = 43;

holly.getsMarried('Gonzales');

console.log(holly.greeting());