jquery

use addClass if you have many elements in favor of .hide() and removeClass for show();

.hide {
    display:none;
}

$('tr').addClass('hide')
$('tr').removeClass('hide')

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);
});