title: How can I pre-set arguments in JavaScript function call? (Partial Function Application)
body: <p>I am trying to write a JavaScript function that will return its first argument(function) with all the rest of its arguments as preset parameters to that function.</p>
  
  <p>So:</p>
  
  <pre>function out(a, b) {
      document.write(a + " " + b);
  }
  
  function setter(...) {...}
  
  setter(out, "hello")("world");
  setter(out, "hello", "world")();
  </pre>
  
  <p>Would output "hello world" twice.  for some implementation of setter</p>
  
  <p>I ran into an issue with manipulating the arguments array on my first try, but it seems there would be a better way to do this.</p>