JavaScript For ....In Statement
Syntax
for (variable in object)
{
code to be executed
}
The variable argument can be named variable, an erray element, or a property of an abject.
Example
<html>
<body>
<script type="text/javascript">
var x
var my cars =new Array( )
mycars [0] = "Saab"
mycars [1] = "Volvo"
mycars [2] = "BMW"
for ( x in my cars)
{
document.write (mycars [x] + "<br />")
}
</script>
</body>
</html>
April 23, 2009
0 JavaScript For ....In Statement
Posted by raj on 2:25 AM
0 comments:
Post a Comment