each with javascript object

a javascript object can't be used like obj.each(function()...
but we can use jquery's each function:

$.each(obj, function( i, val ) {
  console.log(i+": "+val);
});