for loop in jquery array

JavaScript
var i;
for (i = 0; i < cars.length; i++) { 
  text += cars[i] + "<br>";
 }//Array
$.each( arr, function( index, value ){
    sum += value;
});

//Object
$.each( obj, function( key, value ) {
    sum += value;
});$.each( obj, function( key, value ) {
  alert( key + ": " + value );
});
Source

Also in JavaScript: