/// <summary>
/// Class that represents a customer of our store.
/// The constructor receives the name of the customer
/// </summary>
/// <param name="firstName"> First name of the customer.
/// <param name="lastName"> Last name of the customer.
function Customer(firstName, lastName)
{
// Properties
this.FirstName = firstName;
this.LastName = lastName;
}
Customer.prototype = {
/// <summary>
/// Returns the first name of the customer
/// </summary>
GetFirstName: function()
{
return this.FirstName;
},
/// <summary>
/// Returns the last name of the customer
/// </summary>
GetLastName: function()
{
return this.LastName;
},
...
}
Usage:
var aCustomer = new Customer("Pablo","Bustos");
alert("Hello " + aCustomer.GetFirstName());