Java Script is a fully object oriented Programming (OOP) language.

It has 3 (Private, Privilege and Protected) modifiers.

Private Variables:

  • Declared with in var keyword.
  • Accessed via private and privilege methods

Private functions:

  • Declared inline, inside the object constructor.
  • var function_name = function(){…}
  • can only be accessed via privilege methods and object constructor.

Privilege Method:

  • this.method_name = function(){ … }
  • Can access by external to object

Public Properties:

  • this.variable_name = someValue
  • Can access from outside the object

Public Method:

  • classname.prototype.method_name = function(){ … }
  • Can be called from outside the object

Prototype Properties:

  • classname.prototype.property_name = someValue

Static Properties:

  • classname.property_name = someValue

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.