Advertisement
Guest User

Untitled

a guest
Apr 8th, 2019
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. function ClassTwo(name, pw, mail){
  2. // Exercise Two: Now that you have created your own class,
  3. // you will create a class with a method on it.
  4. // In this class create 4 properties: username, password, email, and checkPassword.
  5. // Set the value of username to name,
  6. // Set the value of password to pw,
  7. // Set the value of email to mail
  8. // Set the value of checkPassword to a function.
  9. // The checkPassword function takes a string as it's only argument.
  10. // Using the 'this' keyword check to see if the password on the class is the same as
  11. // the string being passed in as the parameter. Return true or false.
  12. this.username = name;
  13. this.password = pw;
  14. this.email = mail;
  15.  
  16. this.password = function(userPassword){
  17. this.password === pw;
  18. //return true
  19. };
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement