Functions as parameters (with parameters) -- JavaSript
<p>If I have some OO javascript that looks like so:</p>

<pre><code>function someFunction(a, b, c) {
  // do something with a, b, and c
}

function theLoader() {
    loadFunction: someFunction,
    load: function() {
      // invoke the loadFunction with the proper parameter set
    }
}

var myLoader = new theLoader();
myLoader.load();
</code></pre>

<p>Let's assume that 'theLoader' is expected to be abstract and generic.  I could call it and set the 'loadFunction' to almost anything, so I don't know what the arguments are going to be at any given time.  The 'load' method must invoke the 'loadFunction' and somehow be able to get an argument set to it....</p>

<p>How can I accomplish what I'm trying to do?  If this is a bad way to go about it, we can totally refactor the code.  I'd like to keep restrictions off of the 'loadFunction' so I don't have to code loader functions in a special way.  </p>

<p>At the end of the day, I'd like to package theLoader into it's own .js file and not have to monkey with it.</p>

<p>So -- if you know the answer, help a brother out!!</p>

<p>Thanks,
g</p>
