Example of the use of .each in jQuery
var $a = [1,2,3,4]; function parseNumber($data){ $.each($data,function(index, value){ console.log(index + ' ' +value); }); } parseNumber($a); /* It will print: 0 1 1 2 2 3 3 4 */