Tweaking your Community

:)aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

You are not connected. Please login or register

JS Objects Introduction

Go down  Message [Page 1 of 1]

1JS Objects Introduction Empty JS Objects Introduction Sun May 02, 2010 8:34 am

sir.penney

sir.penney
Administrator
Administrator

Javascript is an Object Oriented Programming (OOP) language.

An OOP language allows you to define your own objects and make your own variable types.
Object Oriented Programming

Javascript is an Object Oriented Programming (OOP) language. An OOP language allows you to define your own objects and make your own variable types.

However, creating your own objects will be explained later, in the Advanced Javascript section. We will start by looking at the built-in Javascript objects, and how they are used. The next pages will explain each built-in Javascript object in detail.

Note that an object is just a special kind of data. An object has properties and methods.
Properties

Properties are the values associated with an object.

In the following example we are using the length property of the String object to return the number of characters in a string:

var txt="Hello World!";
document.write(txt.length);


The output of the code above will be:
12

Methods

Methods are the actions that can be performed on objects.

In the following example we are using the toUpperCase() method of the String object to display a text in uppercase letters:

var str="Hello world!";
document.write(str.toUpperCase());


The output of the code above will be:
HELLO WORLD!

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum

 



iJerick | Forumotion | Punbb | jQuery | CSS3
Copyright © 2011 TweakGround™. All Right Reserved.

Create a forum on Forumotion | ©phpBB | Free forum support | Report an abuse | Forumotion.com