D
D
Denis Bukreev2016-08-10 21:30:04
JavaScript
Denis Bukreev, 2016-08-10 21:30:04

What do they want from me?

Mastering prototypes to understand exactly how classes work in ES6.
I'm going through tests.
Got this:

// Поправить код, чтобы функция приветствия возвращала ожидаемое значение
function Person(name){
  this.name = name;
}

Person.prototype.greet = function(otherName){
  return "Hi " + otherName + ", my name is " + name;
}

And I generally stood in a stupor.
What needs to be done to make the code work?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Deodatuss, 2016-08-10
@denisbookreev

Person.prototype.greet = function(otherName){
  return "Hi " + otherName + ", my name is " + this.name;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question