//Declaration of Class
var clsMyClasse = function () {
//Declaration of Private Attribute
var atrAtributoPrivado = "Private Attribute";
//Declaration of Private Method
var mtdMetodoPrivado = function () {
//Returns the Private Attribute through the Private Method
return atrAtributoPrivado;
};
//Declaration of Public Attribute
this.atrAtributoPublico = "Public Attribute";
//Declaration of Public Method
this.mtdMetodoPublico = function () {
//Returns the Private Method through the Public Method
return mtdMetodoPrivado();
};
//Declaration of Public Method
this.mtdPerson = function (first, last, age) {
//Declaration of Public Attribute
this.atrFirstName = first;
//Declaration of Public Attribute
this.atrLastName = last;
//Declaration of Public Attribute
this.atrAge = age;
//Declaration of Private Attribute
var atrBankBalance = 7500;
//Declaration of Public Method
this.mtdGetBalance = function () {
//Returns the Private Attribute through the Public Method
return atrBankBalance;
};
};
};
|