Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Javascript Classes-Objects in JavaScript

Related Tutorials


 
 

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

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  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.

Posted on: December 15, 2008

Related Tutorials

Discuss: Classes-Objects in JavaScript   View All Comments

Post your Comment


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