In the process of learning JS... it's mai second week from the first day of JS and i have that big problems with syntax
function Customer(name, street, city, state, email, balance) {
this.name = name;
this.street = street;
this.city = city;
this.state = state;
this.email = email;
this.balance = balance;
this.payDownBal = function(amtPaid) {
this.balance -= amtPaid;
};
this.addToBa = function(amtCharged) {
this.balance += amtCharged;
};
}
var cust2 = new Customer("Sally Smith", "234 Main ", "Pittsburgh", "PA", "[email protected]", 0.00);
cust2.addToBal(15.50);
Customer.prototype.isCreditAvail = true;
Customer.prototype.toString = function() {
return this.name + " lives at " + this.street + " in " +
this.city + " " + this.state + " email : " + this.email +
" and has a balance of $ " + this.balance.toFixed(2) + "Creditworty : " + this.isCredAvail;
}
document.write(cust2.toString());
I can't find the error...can i be helped please ?