Loading ...

How to create a Object in JavaScript | CodeAsp.Net

How to create a Object in JavaScript

 /5
0 (0votes)

In this blog I will explain how to create a Object in JavaScript.

<html>
<head>
<script type="text/javascript">

var info = new Object();

info.Name = "Mohit";
info.Address = "Delhi";
info.PhNo = 100;

alert("Name: " + info.Name + "  Address: " + info.Address + "  PhNo: " + info.PhNo);
 
</script>
</head>

</html>

 

In above code i have created a info object and added properties and assigned value to them.

 

Mohit Kumar

Comments (no comments yet)

Top Posts