JavaScript For Loop in Array
Hello Friends..!!
This is JavaScript Practical: - For Loop in Array.
Script written in small letter because JavaScript Case
Sensitive.
Script:-
<html>
<head>
<title>for in loop example</title>
</head>
<body>
<script type="text/javascript">
var star = new Object();
star.name = "Mahima";
star.type = "Sister";
star.constellation = "Tannu";
for (var starProp in star)
{
alert(starProp + " = " + star[starProp]);
}
</script>
</body>
</html>
Save the File .html
Output:-
If you have any
doubts mention on the Comment Box.
Please follow my Blog, Share and Comment.
Comments
Post a Comment