Logo

Navigation
  • Home
  • Services
    • ERP Solutions
    • Implementation Solutions
    • Support and Maintenance Solutions
    • Custom Solutions
    • Upgrade Solutions
    • Training and Mentoring
    • Web Solutions
    • Production Support
    • Architecture Designing
    • Independent Validation and Testing Services
    • Infrastructure Management
  • Expertise
    • Microsoft Development Expertise
    • Mobile Development
    • SQL Server Database and BI
    • SAP BI, SAP Hana, SAP BO
    • Oracle and BI
    • Oracle RAC
  • Technical Training
    • Learn Data Management
      • Business Intelligence
      • Data Mining
      • Data Modeling
      • Data Warehousing
      • Disaster Recovery
    • Learn Concepts
      • Application Development
      • Client Server
      • Cloud Computing Tutorials
      • Cluster Computing
      • CRM Tutorial
      • EDI Tutorials
      • ERP Tutorials
      • NLP
      • OOPS
      • Concepts
      • SOA Tutorial
      • Supply Chain
      • Technology Trends
      • UML
      • Virtualization
      • Web 2.0
    • Learn Java
      • JavaScript Tutorial
      • JSP Tutorials
      • J2EE
    • Learn Microsoft
      • MSAS
      • ASP.NET
      • ASP.NET 2.0
      • C Sharp
      • MS Project Training
      • Silverlight
      • SQL Server 2005
      • VB.NET 2005
    • Learn Networking
      • Networking
      • Wireless
    • Learn Oracle
      • Oracle 10g
      • PL/SQL
      • Oracle 11g Tutorials
      • Oracle 9i
      • Oracle Apps
    • Learn Programming
      • Ajax Tutorial
      • C Language
      • C++ Tutorials
      • CSS Tutorial
      • CSS3 Tutorial
      • JavaScript Tutorial
      • jQuery Tutorial
      • MainFrame
      • PHP Tutorial
      • VBScript Tutorial
      • XML Tutorial
    • Learn Software Testing
      • Software Testing Types
      • SQA
      • Testing
  • Career Training
    • Career Improvement
      • Career Articles
      • Certification Articles
      • Conflict Management
      • Core Skills
      • Decision Making
      • Entrepreneurship
      • Goal Setting
      • Life Skills
      • Performance Development
      • Personal Excellence
      • Personality Development
      • Problem Solving
      • Relationship Management
      • Self Confidence
      • Self Supervision
      • Social Networking
      • Strategic Planning
      • Time Management
    • Education Help
      • Career Tracks
      • Essay Writing
      • Internship Tips
      • Online Education
      • Scholarships
      • Student Loans
    • Managerial Skills
      • Business Communication
      • Business Networking
      • Facilitator Skills
      • Managing Change
      • Marketing Management
      • Meeting Management
      • Process Management
      • Project Management
      • Project Management Life Cycle
      • Project Management Process
      • Project Risk Management
      • Relationship Management
      • Task Management
      • Team Building
      • Virtual Team Management
    • Essential Life Skills
      • Anger Management
      • Anxiety Management
      • Attitude Development
      • Coaching and Mentoring
      • Emotional Intelligence
      • Stress Management
      • Positive Thinking
    • Communication Skills
      • Conversation Skills
      • Cross Culture Competence
      • English Vocabulary
      • Listening Skills
      • Public Speaking Skills
      • Questioning Skills
    • Soft Skills
      • Assertive Skills
      • Influence Skills
      • Leadership Skills
      • Memory Skills
      • People Skills
      • Presentation Skills
    • Finding a Job
      • Etiquette Tips
      • Group Discussions
      • HR Interviews
      • Interview Notes
      • Job Search Tips
      • Resume Tips
      • Sample Resumes
 

JavaScript Object Oriented Features

By Exforsys | on May 20, 2007 |
JavaScript Tutorial

JavaScript Object Oriented Features

In this JavaScript tutorial you will learn about JavaScript Object Oriented Features, object type, object instantiation, using object properties, using object methods and achieving object instantiation.

Object-oriented capabilities make any language or application powerful. This section outlines the object oriented features supported by JavaScript and how to use them in programming process.

JavaScript is not a complete programming language but, rather, it is a scripting language. There are some object-oriented features that are not supported by JavaScript. JavaScript does not support the features of inheritance, information hiding, encapsulation and classification that are supported by other object-oriented programming languages. Lack of information hiding and lack of encapsulation features in JavaScript cause the methods and properties to only be accessible directly in JavaScript. Similarly, JavaScript does not support the inheritance or classification features. These features cannot be used for developing hierarchy of object types.

The concepts of object reusability and modular approach concept are used by JavaScript in a very limited way. JavaScript can be reused in the Internet only by using SRC attribute (discussed in the SCRIPT tag in an earlier section of this tutorial). Polymorphism, another important feature of Object-oriented programming, is supported by JavaScript using arguments array in function definition, which will be explained in detail in later sections. The lack of these features does not reduce the capabilities of JavaScript in any way. JavaScript has many other compensating features, making it the best scripting language for use in web and server side programming.

Object based Features Supported by JavaScript:

JavaScript supports various features related to object based language and JavaScript is sometimes referred to as an object-based programming language. The vital features which JavaScript supports related to object based are:

Object Type:

JavaScript supports the development of Object types and in this context JavaScript supports both predefined and user-defined objects. It is possible to assign objects of any type to any variable. It is possible to instantiate the defined object types to create object instances in JavaScript, which is a very powerful feature of Object based language. In this context, the limitation of Object type in JavaScript does not permit users to carry out type enforcement on Object types.

Object Instantiation:

To carry out the process of creating specific object instances available in JavaScript, users can make use of a new operator.

These two powerful, object-based features supported by JavaScript described above make this an object model language. In JavaScript, the object types are defined by properties and methods. Properties of Objects are used to access the data values contained in an object. Users can make use of the properties of JavaScript objects for editing as well as reading, depending on whether or not the object’s nature is read only. If the user wants to carry out functions on the object, this is achieved by using methods that make use of the object’s properties.

Using object based features (object properties and methods), in JavaScript:

To use Object Properties:

Syntax for making use of JavaScript object properties is by using the object name followed by dot and then the property name:


objectname.propertyname

To use Object Methods:

Syntax for making use of JavaScript object methods follows the same process as object properties with the difference being that the property name is replaced by the method name and any arguments. To access object methods in JavaScript, the programmer uses the object name followed by dot and then the method name with any arguments:


objectname.methodname(arguments)

How to achieve Object instantiation:

The new operator available feature is used to achieve Object instantiation.

General syntax for new operator for creating objects in JavaScript is as follows:


variablename=new objecttype(arguments)

 

In the above syntax, new refers to keyword and the objecttype(arguments) refer to the constructor. The number of arguments taken by constructors varies from no arguments to one or more than one, depending on the type of object.

An example of object type with constructor taking no arguments:


CD=
new Date()

Date refers to the predefined JavaScript object type. The Date() constructor does not take any parameter and the above statement stores the current date and time to the variable CD.

It is also possible to use the same object type. For example, the Date() constructer taking

a specified date as the parameter and creating object instances for that specified date.


CDD=
new Date(96,3,3)

In this example, instances are created for the specified Date March 3,1996.

« « Literature Can Enhance Your Vocabulary
JavaScript Frame object » »

Author Description

Avatar

Editorial Team at Exforsys is a team of IT Consulting and Training team led by Chandra Vennapoosa.

Free Training

RSSSubscribe 392 Followers
  • Popular
  • Recent
  • JavaScript String Object

    August 12, 2007 - 0 Comment
  • JavaScript Window Object Timeout Methods

    August 8, 2007 - 0 Comment
  • JavaScript Event Handler

    August 2, 2007 - 0 Comment
  • JavaScript Browser Objects Part 2

    June 13, 2007 - 0 Comment
  • JavaScript DOM Window Object

    June 21, 2007 - 0 Comment
  • JavaScript Date Object

    August 12, 2007 - 0 Comment
  • JavaScript Window Object Open Method

    July 4, 2007 - 0 Comment
  • JavaScript Exception Handling – Part I

    August 2, 2007 - 0 Comment
  • JavaScript Windows Object Properties Part I

    August 8, 2007 - 0 Comment
  • JavaScript Math Object

    August 9, 2007 - 0 Comment
  • JavaScript Objects

    August 12, 2007 - 0 Comment
  • JavaScript String Object

    August 12, 2007 - 0 Comment
  • JavaScript Date Object

    August 12, 2007 - 0 Comment
  • JavaScript Math Object

    August 9, 2007 - 0 Comment
  • JavaScript Windows Object Properties Part II

    August 9, 2007 - 0 Comment
  • JavaScript Windows Object Properties Part I

    August 8, 2007 - 0 Comment
  • JavaScript Window Object Timeout Methods

    August 8, 2007 - 0 Comment
  • JavaScript Document Object Methods Part II

    August 7, 2007 - 0 Comment
  • JavaScript Document Object Methods Part I

    August 5, 2007 - 0 Comment
  • JavaScript History Object Properties and Methods

    August 5, 2007 - 0 Comment

Exforsys e-Newsletter

ebook
 

Related Articles

  • JavaScript Objects
  • JavaScript String Object
  • JavaScript Date Object
  • JavaScript Math Object
  • JavaScript Windows Object Properties Part II

Latest Articles

  • Project Management Techniques
  • Product Development Best Practices
  • Importance of Quality Data Management
  • How to Maximize Quality Assurance
  • Utilizing Effective Quality Assurance Strategies
  • Sitemap
  • Privacy Policy
  • DMCA
  • Trademark Information
  • Contact Us
© 2023. All Rights Reserved.IT Training and Consulting
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.AcceptReject Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT