for(var key in object) { if (object.hasOwnProperty(key)) { console.log(key, ': ', object[key]); } }
array.forEach(function(element, index) { console.log(index, ': ', element); });