JS Assignment 13: Intro to Classes in Javascript
maximussallam (5)

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,
this.username = name;
// Set the value of password to pw,
this.passwod = pw;
// Set the value of email to mail
this.email = mail;
// Set the value of checkPassword to a function.
this.checkPassword = 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.


What am I missing in the function?

You are viewing a single comment. View All
a5rocks (576)

@maximussallam oh sorry I was offline... this.checkPassword instead of checkPassword... Sorry my mistake.