Share on Google+Share on Google+

Classes-Objects in JavaScript

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

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

Advertisement

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

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Discuss: Classes-Objects in JavaScript   View All Comments

Post your Comment


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