Answer the question
In order to leave comments, you need to log in
What does displayInfo do in this code?
What does "this.displayInfo = function()" do in this code?
And why doesn't it print "Name: ${this.name} Age: ${this.age}"
function User(name, age) {
this.name = name;
this.age = age;
this.displayInfo = function() {
console.log(`Имя: ${this.name} Возраст: ${this.age}`);
}
}
User.prototype.sayHi = function() {
console.log(`Привет, меня зовут ${this.name}`);
};
module.exports = User;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question