Classes-Objects in JavaScript

In this article you will learn the basics Classes and Objects of JavaScript and create the examples of Classes and Objects in JavaScript .

Ads

Tutorials   
Ads

Classes-Objects in JavaScript

     

In this article you will learn the basics Classes and Objects of JavaScript and create the examples of Classes and Objects in  JavaScript .

About Object 
JavaScript is a object oriented programming language so, its variables is depending upon the objects. In object oriented programming language , user create own object to use variables types. An object is a special kinds of data and it contains the properties and methods. JavaScript has several built in objects. Such as: Array, String, Date e.t.c. .

Syntax to create an object:- 
   
object_Name.properties_Name 

 

The example to create an object and display the some results:-

<html>
<body>

<script language=javascript">

stuobj=new Object()
stuobj.name="vinod"
stuobj.roll=10
stuobj.sub="Computer"
document.write("Student Name :- "+stuobj.name + " Roll no. :- " +stuobj.roll + " Subject :- " +stuobj.sub);

</script>
</body>
</html>

 

Advertisements

Share on Google+Share on Google+

Classes-Objects in JavaScript

Posted on: December 15, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

 

Discuss: Classes-Objects in JavaScript   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0

Ads

 

Ads