Introduction to classes
poysed2code (1)

Can anyone help me with this question as I am stuck. The question is asking to set values in a class that was created one of which is set to a function("ceckPassword"). I am stuck at the part which asks to check if the new value ("checkPassword") is the same as an existing value (" password") and return true or false. Here's the question and my response:
function ClassTwo(name, pw, mail){
// Set the value of username to name,
// Set the value of password to pw,
// Set the value of email to mail
// Set the value of checkPassword to a function.
Here is my ateempt to answer:
this.username = name,
this.password = pw,
this.email = mail,
this.checkPassword = function(){

return this.password === this.checkPassword;

You are viewing a single comment. View All
Answered by a5rocks (502) [earned 5 cycles]
View Answer
poysed2code (1)

@a5rocks I will let you know the outcome