Tampilkan objek di array
//Example: 1
var arr =[1,2,4,5,6];
$.each(arr,function(index,obj)
{
//We can access the object using obj or this
alert("index:"+index + " , value: "+obj +" , value:"+this);
});
//Example: 2 (JSON Array)
var arr2 =[{
name:"Ravi",
age:33,
loc:"India",
},
{
name:"Haya",
age:4,
loc:"United States"
},
{
name:"Geek",
age:4,
loc:"Singapore"
}];
$.each(arr2,function(index,obj)
{
alert("Name: "+obj.name+"\n"+"Age:"+obj.age+"\n"+"Location: "+obj.loc+"\n");
});
Tough Turtle