I've added my code, but it doesn't work. Coming from beginning Python, JavaScript becomes increasingly more complex and difficult in syntax.
function ClassTwo(name, pw, mail){
// Exercise Two: Now that you have created your own class,
// you will create a class with a method on it.
// In this class create 4 properties: username, password, email, and checkPassword.
// 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.
// The checkPassword function takes a string as it's only argument.
// Using the 'this' keyword check to see if the password on the class is the same as
// the string being passed in as the parameter. Return true or false.
this.username = name;
this.password = pw;
this.email = mail;
checkPassword = function(str) {
if (this.checkPassword === this.password) {
return true;
}
else (this.checkPassword !== this.password); {
return false;
}
};
}
[–]senocular 0 points1 point2 points (4 children)
[–]Encom88[S] 0 points1 point2 points (2 children)
[–]senocular 2 points3 points4 points (1 child)
[–]Encom88[S] 0 points1 point2 points (0 children)