Hi,

I have written a loop for the following "ducumentum" Array which is in employees var... but I am getting strange result, it is printing only the last one "Nagesh".

Am I doing anything wrong here...? please help...

<script>
var employees = {"documentum":[
{"firstName":"Ravi"},
{"firstName":"Murali"},
{"firstName":"Nagesh"}
]
};

function employeesList(){
for(i=0; i<employees.documentum.length; i++){
var list = employees.documentum[i].firstName;

}
alert(list);
}
window.onload = employeesList;
</script>

Thank you so much for help...