Answer the question
In order to leave comments, you need to log in
What is it called?
I solve elementary (not for me) problems on codewars, and I didn’t understand the moment:
function Sleigh() {
this.name = "Santa Claus";
this.password = "Ho Ho Ho!";
}
Sleigh.prototype.authenticate = function(name, password) {
return this.name == name && this.password == password;
};
Answer the question
In order to leave comments, you need to log in
Seems like one of the OOP options for JS =)
prototype says that all instances of the class *** will have such a property / method
function Охранник() {
this.name = "Штирлиц";
this.password = "У вас продается славянский шкаф?";
}
Охранник.prototype.проверяй = function(name, password) {
return this.name == name && this.password == password;
};
let Василий = new Охранник()
Василий.проверяй('Штирлиц', 'У вас продается славянский шкаф?')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question