File: script.js

Recommend this page to a friend!
  Classes of Renato Menezes Portugal   Using OOP in JavaScript   script.js   Download  
File: script.js
Role: Class source
Content type: text/plain
Description: Principal Class
Class: Using OOP in JavaScript
Use private and public functions and variables
Author: By
Last change:
Date: 10 years ago
Size: 1,228 bytes
 

Contents

Class file image Download
//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; }; }; };