問題は、キー変数と値変数の両方がオブジェクトとして設定されていることです。これらをテキスト文字列に変換するにはどうすればよいですか?
units = [];
$('thead th[style*="width:130px;line-height:1.2em;text-align:center"]').each(function() {
key = $(this).contents('')[4];
value = $(this).contents('')[6];
units[key] = value;
});