title: Calling Javascript function in a hash
body: <p>I'm having some issues figuring how to call a function that I pass into a hash as part of another object.  So, I have this constructor to create the objects:</p>
  
  <pre><code>function CheckField(jquery_id, test) {
      this.jquery_obj=$(jquery_id);
      this.test=function() {test(this.jquery_obj);};
  }
  </code></pre>
  
  <p>Somewhere else in the code I store these objects with custom test functions for each of them into a hash and iterate through them to set them to be called on an interval:</p>
  
  <pre><code>var fields_to_check = {};
  fields_to_check["qt_num_box"] = new CheckField("#qt_num_box", function(qnb){return invalid_quotes(qnb);});
  fields_to_check["total_num_lines_box"] = new CheckField("#total_num_lines_box",
                                                          function(tnlb) {
                                                              return isNaN(tnlb()) || 0 &gt;= tnlb.val();
                                                          });
  //...
  for (var key in fields_to_check) {
      unsafeWindow.console.log("Setting interval for "+key);
      setInterval(set_textbox_border(fields_to_check[key].test, 10000);
  }
  </code></pre>
  
  <p>I'm getting hung up on how to call the custom test function for each of the <code>CheckField</code> objects that I store into <code>fields_to_check</code>.</p>
  
  <p>How can I call the custom test function for each item in the hash?</p>