latest Post

Array Object program in JavaScript



<html>
<head>
<title>Array Object</title>
<script language="javascript" type="text/javascript">
document.write("<h1 align='center'><font color='orange'>Array Object</font></h1><hr/>");
var arr1 = new Array(4,"ram","ram@gmail.com","america");
 var arr2 = new Array();
arr2["User ID"] = 5;
arr2["User Name"] = "Johnny";
arr2["E-mail"] = "jhon@yahoo.com";
arr2["City"] = "usa";
for(var i = 0; i < arr1.length; i++)
{
                document.write(arr1[i] + "<br/>");
}
document.write("<br/><br/>");
var ind;
for(ind in arr2)
{
                document.write(ind);
                document.write("---------------");            
                document.write(arr2[ind] + "<br/>");
}
</script>
</head>
<body>
</body>
</html>

About Mallikarjun A

Mallikarjun A
Recommended Posts × +

0 comments:

Post a Comment