java Scripts :: associated array in Javascripts
<script>
//for in loop only used associated array
var x;
var person={Rollno:111, fname:"payal",lname:"joshi"};
for (x in person)
{
document.write(person[x] + " ");
}
document.write("<br><br><br>");
document.write(person['Rollno']+"<br>");
document.write(person['fname']+"<br>");
document.write(person['lname']+"<br>");
var a={a:10,b:20,c:30,d:40};
var x1;
for(x1 in a)
{
document.write("<br>"+a[x1]);
}
</script>
//for in loop only used associated array
var x;
var person={Rollno:111, fname:"payal",lname:"joshi"};
for (x in person)
{
document.write(person[x] + " ");
}
document.write("<br><br><br>");
document.write(person['Rollno']+"<br>");
document.write(person['fname']+"<br>");
document.write(person['lname']+"<br>");
var a={a:10,b:20,c:30,d:40};
var x1;
for(x1 in a)
{
document.write("<br>"+a[x1]);
}
</script>
java Scripts :: associated array in Javascripts
Reviewed by Unknown
on
7:35:00 PM
Rating:
No comments: