Something is wrong in JavaScript object declaration
<p>This code:</p>

<pre><code>var doc = {
  foldPrompt: function(folded) {
    return folded ? "Click to unfold" : "Click to fold"
  },
  createFoldButtons: function() {
    var prompt = foldPrompt(true); //The error is here
    $("#ComparisonTable td.secrow").each(function(index, td){
      $(td).prepend($('&lt;img src="minus.gif" class="foldbtn" alt="'+prompt+'" title="'+prompt+'"&gt;'));
    });
  }
}
</code></pre>

<p>gives me an error: <code>Undefined variable: foldPrompt</code></p>

<p>What am I doing wrong?</p>
