jQuery(document).ready(function(){
var arr = [ "earth", "mars", "jupiter", "saturn", "venus" ];
var obj = { one:"earth", two:"mars", three:"jupiter", four:"saturn", five:"venus" };
jQuery.each(arr, function(i, val) {
$("#arrData").append(i + " : " + val + "<br/>");
});
jQuery.each(obj, function(i, val) {
$("#objData").append(i + " : " + val + "<br/>");
});
});
the run and find diffrence in i as yo print this code; an array and object
No comments:
Post a Comment